$24.99
Assignment-1
• Your submission should be a single zip file 2022xxx HW1.zip (Where 2020xxx is your roll number). Include all the files (code and report with theory questions) arranged with proper names. A single .pdf report explaining your codes with results, relevant graphs, visualization and solution to theory questions should be there. The structure of submission should follow:
2022xxx HW1
|− code rollno.py/.ipynb
|− report rollno.pdf
|− (All other files for submission)
• Anything not in the report will not be graded.
• Your code should be neat and well commented.
1. (11 points) Section A (Theoretical)
(i) A credit card company wants to use ML to determine whether to approve or reject an applicant’s credit card application.
(ii) A hospital wants to use ML to predict patient outcomes and develop personalized treatment plans.
(iv) A law enforcement agency wants to use ML to identify potential suspects in a criminal investigation.
Provide a detailed explanation for your answer for each scenario, highlighting the potential benefits and risks associated with the use of ML.
2. (9 points) Section B (Code Implementation)
(i) Load the titanic dataset, print the shape and show the first ten rows and the last ten rows from the dataset.
(ii) Find if there exist any null values in the dataset.
(iii) Plot the countplot from the training dataset and comment on it.
(iv) Find inference on how many males and females survived using groupby() and count() methods on training dataset.
(v) Plot countplot for ‘Pclass’ feature showing count of Survived vs Dead on training data. Comment on it.
(vi) Find the oldest, youngest and the average of the person who survived.
(vii) Display a crosstab (available in pandas library) depicting males and females survived or died for each ‘Pclass’. Also explain your observations.
(viii) ‘SibSp’ feature indicates whether a person is alone or with his family. Siblings = {brother, sister} and Spouse = {husband, wife}. Plot the crosstab for SibSp showing how many persons survived or died. Also plot factorplot for SibSp vs Survived. Comment on your observations.
Note - Plots should have proper labels, titles and legends.
(i) playlist(Name, Songs): This predicate creates a new playlist with the given Name and an empty list of Songs.
(ii) add song(Name, Title, Artist, UpdatedPlaylist): This predicate adds a new song with the given Title and Artist to the playlist with the given Name. The UpdatedPlaylist should be a new playlist with the added song.
Page 2
(iii) display playlist(Name): This predicate displays the Name of the playlist and the list of Songs in the playlist.
Your Prolog program should make use of the following built-in predicates: • cut: Use the cut predicate to prevent backtracking and ensure that only one solution is found for each predicate call.
• fail: Use the fail predicate to explicitly fail a predicate and force backtracking.
• list: Use the list data structure to store the songs in each playlist.
• append: Use the append predicate to concatenate lists when adding a new song to a playlist.
Page 3