MACHINE LEARNING · CLASSIFICATION

Megaline Customer
Plan Classification

Building a machine learning model to recommend the right mobile plan based on customer behavior.

PythonScikit-learnRandom ForestClassification

Can customer behavior predict the right mobile plan?

Megaline wants to migrate customers away from legacy plans. The goal of this project was to build a classification model capable of recommending either Smart or Ultra based on monthly customer behavior.

Customers
75%Required Accuracy
82.43%Final Test Accuracy
+9.96ppvs. Dummy Baseline

Understanding the customer base

Each observation represents one customer's monthly behavior, including calls, minutes, messages and mobile data usage. The target variable identifies whether the customer uses the Smart or Ultra plan.

Smart0% of customers
0
Ultra0% of customers
0
PLAN MIXCustomer distribution customers
Smart 0%Ultra 0%

Train, validate, test

The dataset was split into three subsets to train the models, compare their performance, and evaluate the final model on unseen data.

60%TrainUsed to train the models.
20%ValidationUsed to compare models and tune hyperparameters.
20%TestUsed only for the final evaluation.

Which model performs best?

Three classification algorithms were trained under the same train-validation split. Each model was first evaluated with its default configuration and then tuned using hyperparameters.

Decision Tree
Default68.74%
Tuned78.23%
max_depth = 10
BEST MODELRandom Forest
Default78.23%
Tuned80.25%
n_estimators = 10 · max_depth = 10
Logistic Regression
Default67.50%
Tuned67.81%
C = 0.01

Does the model actually work?

After selecting Random Forest using the validation set, the final model was evaluated on the untouched test set and compared against a dummy baseline that always predicts the majority class.

Dummy Baseline72.47%Always predicts the majority class
Random Forest82.43%Final accuracy on unseen test data
+9.96 percentage pointsimprovement over the sanity-check baseline

Try a prediction

Adjust monthly customer behavior and test the trained Random Forest model directly in the browser.

40
130
80
20,000 MB