Question
Note: Provide justifications/calculations/steps along with each answer to illustrate how you arrived at the answer. State your arguments clearly, in logical sequence and present a
Note: Provide justifications/calculations/steps along with each answer to illustrate how you arrived at the
answer. State your arguments clearly, in logical sequence and present a well commented code. You will not
receive credit for giving an answer without sufficient explanation.
Questions
Q1: Read the breast cancer dataset from sklearn as per the following details
(from sklearn.datasets import load_breast_cancer)
(a) Check the data by converting the built-in data set to a Pandas dataframe.
(b) Split the data into training and test sets (a ratio of 75:25).
(c) Build a logistic regression model on the above data.
(d) Plot the ROC and calculate AUC for the training data and find the best threshold.
(e) Based on this threshold, classify your test data.
Q2: Extract the stock market data from Yahoo finance for a set of any 15 companies of four different
sectors during 01.04.2017 to 31.09.2021. Make use of the following attributes on the data:
Highest price of the day
Minimum price of the day
Opening price of the day
Closing Price of the day
Take the average of these four attributes as an average movement of the day. Now apply k-Means
clustering to cluster the chosen 15 companies as per their respective sectors.
Q3: Explore the application of k-means clustering in color compression of a color image. To explore it,
read an image having multiple colors where a large number of colors will be unused, and many of the
pixels in the image will have similar or even identical colors. Cluster these several colors into a 16
different clusters and show the compressed image.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started