logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

best performing features using feature extraction in scikit Learn ,Standardize your features to Gaussian distribution

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Need help within one day

 

  1. Find the best performing features using feature extraction in scikit Learn. (10)
  2. Standardize your features to Gaussian distribution. (5)

patients_tobeScaled = patients.drop(['Diagnosis'],axis=1) scaler = preprocessing.StandardScaler()

C. Split the dataset into 60/40 training and testing. (5)

y = patients.Diagnosis
x_train,x_test,y_train,y_test = train_test_split(patients_scaled,y,test_ size=0.4,random_state=42, stratify=y)

 

  1. Create a logistic regression model (call it LRM1) using your best features. Describe

your model. (10)

# First drop the least important attribute you identified in your feature selection. Replace the “FeatureName” with the attribute you want to exclude x_train = x_train.drop(['FeatureName'],axis=1)
x_test = x_test.drop(['FeatureName'],axis=1)

#Create the first logistic regression model LRM1 = LogisticRegression() LRM1.fit(x_train,y_train)

 

  1. Create classification report of your model. (5)

predictions_LRM1 = LRM1.predict(x_test)

print(classification_report(y_test, predictions_LRM1))

 

  1. Describe your classification report (precision, recall, F1 score, and support). (10)
  2. Create the accuracy score of your model. Describe the accuracy score. (10)
  3. Create another logistic regression model (call it LRM2). Use all the independent

features this time (instead of your best performing features). (10)

  1. Compare the two models (LRM1 and LRM2) based on the classification report and

accuracy score. Which one is a better model? Why? (10)

  1. Create a Naïve Bayes model (call it NBM) using 60/40 split. (10)
  2. Create classification report of your NBM model. (5)
  3. Describe your classification report of NBM (precision, recall, F1 score, and support).

(5)

  1. Create the accuracy score of your NBM model. Describe the accuracy score. (10)
  2. Compare the logistic regression (LRM1 or LRM2) with the Naïve Bayes model

(NBM). Which one is better? Why? (10)

  1. What would be your suggestions for further improving the accuracy of your chosen

model? (10)

page1image7890880

from sklearn.ensemble import ExtraTreesClassifier X = patients.drop(['Diagnosis'],axis=1)
Y = patients.Diagnosis
model = ExtraTreesClassifier()

model.fit(X, Y)
# Print the relative importance of each feature print(model.feature_importances_) print(patients.columns)

 

 

(5/5)
Attachments:

Expert's Answer

1293 Times Downloaded

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

1293 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Husnain SaeedComputer science

870 Answers

Hire Me
expert
Atharva PatilComputer science

533 Answers

Hire Me
expert
Chrisantus MakokhaComputer science

753 Answers

Hire Me
expert
AyooluwaEducation

853 Answers

Hire Me

Get Free Quote!

382 Experts Online