Question: Exercise _ 6 . ipynb File Edit View Insert Runtime Tools Help Allchanges savedXiChrome File Edit View History Bookmarks Profiles Tab Window Help M 6

Exercise_6.ipynb
File Edit View Insert Runtime Tools Help Allchanges savedXiChrome
File
Edit
View
History
Bookmarks
Profiles
Tab
Window
Help
M6: Exercise 6
Montclair State Un
Home - Google Dr
Exercise_6.ipynb
Fit a logistic regres
Fit a decision tree
colab.research.google.com/drive/1reKpEkvaa3XULHEy8jTI8VWL4hKHSvvE#scrollTo=D-O6pUSwXGi1
Exercise_6.ipynb
File Edit View Insert Runtime Tools Help All changes saved
\table[[+ Code + Text],[6s [2],3,0.480519,0.105882,0.133333,0.148750,0.000000,0.0,0.0,0,0,0,...,0],[**,,0.467532,0.079851,0.133333,0.172983,0.016129,0.0,0.0,0,0,0,,0]]
5 rows 43 columns
Question 1
Create x_train, y_train, x_test, y_test variables
Split the dataset into training and testing.
Assign the training input dataset to x-train, assign the test input dataset to x-test, assign the training output dataset to y?train, assign the training output dataset to y-test
The size of your training data should be 70% of the size of the original dataset. The size of the test data should be 30% of the original dataset
The output variable (also known as the Y variable or the target variable) in this dataset is deposit_yes
os
'''Your code goes in this cell.'''
from sklearn.model_selection import train_test_split
x = df_bank_processed.drop('deposit_yes', axis=1)
y = df_bank_processed['deposit_yes']
x_train, x_test, y_train, y_test = train_test_split(x,y, test_size =0.3, random_state =42
Exercise _ 6 . ipynb File Edit View Insert

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!