Lesson 2 - Logistic Regression for Classification

:arrow_forward: Lecture Video will be available on the course page :point_up_2:

Topics Covered:

  • Downloading & processing Kaggle datasets
  • Training a logistic regression model
  • Model evaluation, prediction & persistence

:spiral_notepad: Notebooks used in this lesson:

:writing_hand: Please provide your valuable feedback on this link to help us improve the course experience.

:computer: Join the Jovian Discord Server to interact with the course team, share resources and attend the study hours :point_right: Jovian Discord Server

:question: Asking/Answering Questions

Reply to this thread to ask questions. Before asking, scroll through the thread and check if your question (or a similar one) is already present. If yes, just like it. We will give priority to the questions with the most likes. The rest will be answered by our mentors or the community. If you see a question you know the answer to, please post your answer as a reply to that question. Let’s help each other learn!

for age factor should scaling be consirdered ? if i dont include age in scaling will it affect in accuracy of the model?

I think it should be considered, you can try and see what effect does it have. Maybe it can increase the accuracy of the model.

okay i will thank you very much

Hey @aakashns ,can we have a friendly kaggle competition(like we had for pytorch: zero to Gans) for this course as well?

model.fit(train_inputs[numeric_cols + encoded_cols], train_targets)

i have tried running this block of code and i keep getting this error

ValueError Traceback (most recent call last)
in ()
----> 1 model.fit(train_inputs[numeric_cols + encoded_cols], train_targets)

ValueError: operands could not be broadcast together with shapes (16,) (102,)

@aakashns Sir , I built the model on breast cancer logistic regression , the model accuracy came out to be 91% , but when I was testing this model’s efficiency on random_guess model and all_no model , the accuracy came out to be 54% and 36% respectively.Is it expected or something is wrong?
Also , I was testing the model by providing the new single input in the end for prediction and I was scaling it the way I did for training and test set , but the new single input was not getting scaled.I am using the same scaler object.I wonder why.

I don’t remember exactly, so could be wrong but I think the random_guess model and all_no model were models that predicted a random guess and no respectively for any input value.

They are basically for reference, like suppose the model we trained has an accuracy of 50%, and then you see that a random_guess model(a model that predicts with a random guess and requires no training/modeling, etc.) has an accuracy of 54%
Then this would imply that our 50% accurate model is not a very successful model and requires changes.

In case I remember wrong and random_guess and all_no are test cases, then you would have to check your model for overfitting.

1 Like