Regularization and probabilities
In this exercise, you will observe the effects of changing the regularization strength on the predicted probabilities.
A 2D binary classification dataset is already loaded into the environment as X
and y
.
This exercise is part of the course
Linear Classifiers in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Set the regularization strength
model = LogisticRegression(C=1)
# Fit and plot
model.fit(X,y)
plot_classifier(X,y,model,proba=True)
# Predict probabilities on training points
prob = model.predict_proba(X)
print("Maximum predicted probability", ____)