Question: Os df . head ( 3 ) table [ [ , User ID , Gender,Age,EstimatedSalary,Purchased ] , [ 0 , 1 5 6 2

Os
df.head (3)
\table[[,User ID,Gender,Age,EstimatedSalary,Purchased],[0,15624510,Male,19,19000,0],[1,15810944,Male,35,20000,0],[2,15668575,Female,26,43000,0]]
Next steps:
Generate code with df
View recommended plots
After looking at the data, drop irrelevant features (such that have no learnability meaning) and make sure your remaining features are numeric.
# Implement here
Plot on the densities of the features, choose the scaler we will be using.
Write here your answer and explain it
1s
from sklearn.model_selection import train_test_split # Implement here
Split the data into 80% train samples and 20% test samples, with random state 42.
Split the train into real train (70%) and validation (30%) with random state 42.
Apply the scaler on the train, validation and test sets.
Remember: when scaling the test, it should use all the training data.
Tip: For minimizing the loss function, what labels did we look at? Are they the same here?
[] # Import scaling library
# Implement here
Implement the function Logistic_Regression_via_GD(P,y,Ir):
Input: an np array 'P' of 'n' rows and 'd' columns, a label vector 'y' of 'n' entries and learning rate parameter 'Ir'.
Output: The function computes the output vector 'w'(and 'b') which minimzes the logistic regression cost function on 'P' and 'y'.
The implementation should be fully yours. Don't use library implementation!
It should be done by implementing Gradient descent (with 'Ir' as the learning rate) to solve logistic regression.
Tip: The gradients may be large, you can use 1ngradL (which is the true empirical loss' gradient)
 Os df.head (3) \table[[,User ID,Gender,Age,EstimatedSalary,Purchased],[0,15624510,Male,19,19000,0],[1,15810944,Male,35,20000,0],[2,15668575,Female,26,43000,0]] Next steps: Generate code with df

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 Databases Questions!