Predicting 0 or 1
based on continuous variables
- Linear models
- Logistic regression
What are the coefficients of logistic regression? log(odds)
Back to the linear models...
Search for optimal alpha and lambda
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec metus justo. Aliquam erat volutpat.
One iteration is one pass over the entire data set.
Different optimization technique
https://towardsdatascience.com/dont-sweat-the-solver-stuff-aea7cddc3451
F1 (Good for imbalanced class)
fpr, tpr, thresholds = metrics.roc_curve(y_test, y_pred)
predicted there is no event, but there is actually one
predicted there is event, but there is none
-> lead to higher cost calculations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec metus justo. Aliquam erat volutpat.
- Regularisation strength: In glmnet, higher lambda means more shrinkage. glmnet defaults to 100 lambdas to try
- Standardisation: an glmnet argument standardizes for the data, and the default is TRUE
- CV: k-fold
- Regularisation strength: in the sklearn, C is "the inverse of regularaization strength (lambda). Smaller values specify stronger regularization". scikit LogisticRegressionCV defaults to 10
- Standardisation: no default scaling.
- CV: stratifiedfolds
for Iinear regression
Need for linear regression
Standardizing the features makes the convergence faster
Normally not needed for logistic regression
But regularization makes the predictor dependent on the scale of the features.
for logistic regression
(Z-score standardisation)
transform the features such that its distribution will have a mean value 0 and standard deviation of 1
Values not within [0, 1]
sensitive to outlier
(Min max normalisation)
rescales the data set such that all feature values are in the range [0, 1]
sensitive to outlier