Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scenario You are a data scientist working for StreamFlex, a subscription-based streaming service offering movies, TV shows, and live sports content. Recently, StreamFlex has observed an increase in customer churn, meaning some users are cancelling their subscriptions. Your task is to analyze customer data and build predictive models to identify customers who are likely to churn. You will use Decision Trees and Random Forests to model customer behavior and extract actionable business insights that can help StreamFlex reduce churn. StreamFlex has provided you with a dataset containing customer information related to demographics, usage behavior, subscription details, and customer support interactions.

Dataset Description You will work with the dataset: customer_churn.csv The dataset includes the following attributes: Customer Attributes • Age • Subscription_Length_Months • Watch_Time_Hours • Number_of_Logins • Preferred_Content_Type • Membership_Type (Basic, Standard, Premium)

pg. 2 • Payment_Method • Payment_Issues • Number_of_Complaints • Resolution_Time_Days Target Variable • Churn o 0 → Customer did not churn o 1 → Customer churned

Important Note: Although the business scenario mentions customer location, location data is not included in this dataset. Students must work only with the variables provided in customer_churn.csv.

Assignment Objectives By completing this assignment, you will: • Apply Decision Trees and Random Forests to a real-world business problem • Perform exploratory data analysis (EDA) • Evaluate classification models using appropriate metrics • Interpret model results and translate them into business insights • Practice professional reporting and documentation

Assignment Deliverables You are required to complete all sections below.

Section 1 – Decision Trees in Business (Theoretical Analysis) (Written analysis) Answer the following questions:

pg. 3

  1. Why are Decision Trees well suited for predicting customer churn?
  2. What are the advantages of Decision Trees from a business decision-making perspective?
  3. How can churn predictions be used by StreamFlex to: o Improve customer retention? o Design targeted marketing strategies? o Enhance customer support operations?

Section 2 – Python Implementation All practical work must be done in Python using scikit-learn, pandas, matplotlib, and/or seaborn. Important: When submitting your report, you must include a comprehensive set of screenshots showing: • Code execution • Outputs • Tables • Visualizations Screenshots are mandatory and will be graded.

Task 1 – Data Preparation and Exploration (EDA)

  1. Load customer_churn.csv into Python.
  2. Display: o Dataset structure o Summary statistics
  3. Identify and handle missing values.
  4. Perform exploratory data analysis:

pg. 4

o Histograms o Box plots o Correlation analysis 5. Briefly describe any important patterns or anomalies you observe.

Task 2 – Decision Tree Classifier

  1. Split the dataset into training and testing sets.
  2. Train a Decision Tree Classifier.
  3. Use GridSearchCV to tune hyperparameters (e.g., max_depth, min_samples_split).
  4. Visualize the trained Decision Tree.
  5. Evaluate the model using: o Accuracy o Precision o Recall o F1-score o Confusion Matrix Include screenshots of: • Model training • Best parameters • Evaluation results

Task 3 – Random Forest Classifier

  1. Train a Random Forest Classifier.
  2. Compare its performance with the Decision Tree model.
  3. Analyze feature importance.

pg. 5 4. Explain: o Which features contribute most to churn o Why Random Forest may outperform a single Decision Tree

Task 4 – Business Insights and Recommendations Based on your analysis:

  1. Identify the key factors driving customer churn.
  2. Provide three concrete, actionable business recommendations StreamFlex can implement to reduce churn.
  3. Explain how your model supports these recommendations.

Submission Requirements You must submit all of the following on Moodle:

  1. Written Report (PDF) o Length: 5–7 pages o Includes: ▪ Theoretical analysis ▪ Methodology ▪ Results ▪ Visualizations ▪ Business insights o Must include screenshots of all practical steps
  2. Python Code o Jupyter Notebook (.ipynb) or o Python script (.py) o Well commented and clearly structured

pg. 6 Evaluation Criteria

Criteria Weight Theoretical Understanding 10% Data Exploration & Cleaning 20% Model Implementation 30% Performance Evaluation 20% Business Insights & Recommendations 20%

Academic Integrity • All submitted work must be original. • Plagiarism or misuse of AI-generated content without understanding will result in academic penalties. • You may use AI tools only as learning aids, not as substitutes for analysis.

Learning Expectations • Not all techniques used in this assignment may have been fully covered in lectures. • You are expected to: o Explore official documentation (e.g., scikit-learn, etc.) o Read external learning resources when needed o Experiment and validate your understanding • This reflects real-world data science practice, where continuous learning is essential.

Final Notes Respect the due date posted on Moodle. Late submissions are subject to course penalties. Clear, well-structured work with strong reasoning will be rewarded.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages