Logistic Regression using Scikit-Learn (score function)

Greetings :raised_hand_with_fingers_splayed:

what is score function?
is it same as cost function?
is (Accuracy = 1) mean good fit or bad fit?


In this case, the score function of the LogisticRegression of SciKit-Learn will tell you how accurate the model is in the “training data”.

Accuracy is not the same as cost function. Cost function is used in the process of the backprop, where the model learns. They actually should have an inverse correlation: The higher the accuracy, the lower the cost. Accuracy is more the result: how well is my model ‘predicting’ when compared to ground truth?

Accuracy = 1 would mean “perfect”. Now, is that good or bad? I would say that probably I would suspect of a 100% accuracy… may be my model is overfitting?

1 Like

Hello Omar @Omar_Alwaily,

This score is measured on the training data, it is a good fit to the training data but this is not how we tell if the model is well generalizing the problem at hand. Instead we evaluate our model on two separate datasets called cv set and test set. The two evaluations serve for different purposes but I will let you watch Andrew’s to explanation on cv in the specialization’s course 2 week 3.


1 Like