Modelling Customer Churn using Logistic Regression and Hyperband

Go to Top

References

Load the libraries

Go to Top

Colab

Useful Scripts

Go to Top

Load the Data

Go to Top

Data Processing

Go to Top

Oversampling: SMOTE

Go to Top

Scaling Numerical Features (Yeo-Johnson)

Modelling: Logistic Regression

Go to Top

LogisticRegression(
    penalty='l2', # 'l1', 'l2', 'elasticnet', 'none'}, default='l2'
    *,
    dual              = False,
    tol               = 0.0001, # default=1e-4
    C                 = 1.0,
    fit_intercept     = True,
    intercept_scaling = 1,
    class_weight      = None, # dict or 'balanced', default=None
    random_state      = None,
    solver            = 'lbfgs', # 'newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'}, default='lbfgs'
    max_iter          = 100,
    multi_class       = 'auto',
    verbose           = 0,
    warm_start        = False,
    n_jobs            = None,
    l1_ratio          = None,
)

solver : {'newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'},             default='lbfgs'

    Algorithm to use in the optimization problem.

    - For small datasets, 'liblinear' is a good choice, whereas 'sag' and
      'saga' are faster for large ones.
    - For multiclass problems, only 'newton-cg', 'sag', 'saga' and 'lbfgs'
      handle multinomial loss; 'liblinear' is limited to one-versus-rest
      schemes.
    - 'newton-cg', 'lbfgs', 'sag' and 'saga' handle L2 or no penalty
    - 'liblinear' and 'saga' also handle L1 penalty
    - 'saga' also supports 'elasticnet' penalty
    - 'liblinear' does not support setting ``penalty='none'``

    Note that 'sag' and 'saga' fast convergence is only guaranteed on
    features with approximately the same scale. You can
    preprocess the data with a scaler from sklearn.preprocessing.

Hyperband SearchCV

Model Evaluation

Go to Top

Time Taken

Go to Top