• Stars
    star
    405
  • Rank 106,656 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    BSD 3-Clause "New...
  • Created about 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A general-purpose framework for solving problems with machine learning applied to predicting customer churn

A Machine Learning Framework with an Application to Predicting Customer Churn

This project demonstrates applying a 3 step general-purpose framework to solve problems with machine learning. The purpose of this framework is to provide a scaffolding for rapidly developing machine learning solutions across industries and datasets.

The end outcome is a both a specific solution to a customer churn use case, with a reduction in revenue lost to churn of more than 10%, as well as a general approach you can use to solve your own problems with machine learning.

Framework Steps

  1. Prediction engineering
  • State business need
  • Translate business requirement into machine learning task by specifying problem parameters
  • Develop set of labels along with cutoff times for supervised machine learning
  1. Feature Engineering
  • Create features - predictor variables - out of raw data
  • Use cutoff times to make valid features for each label
  • Apply automated feature engineering to automatically make hundreds of relevant, valid features
  1. Modeling
  • Train a machine learning model to predict labels from features
  • Use a pre-built solution with common libraries
  • Optimize model in line with business objectives

Machine learning currently is an ad-hoc process requiring a custom solution for each problem. Even for the same dataset, a slightly different prediction problem requires an entirely new pipeline built from scratch. This has made it too difficult for many companies to take advantage of the benefits of machine learning. The standardized procedure presented here will make it easier to solve meaningful problems with machine learning, allowing more companies to harness this transformative technology.

Application to Customer Churn

The notebooks in this repository document a step-by-step application of the framework to a real-world use case and dataset - predicting customer churn. This is a critical need for subscription-based businesses and an ideal application of machine learning.

The dataset is provided by KKBOX, Asia's largest music streaming service, and can be downloaded here.

Within the overall scaffolding, several standard data science toolboxes are used to solve the problem:

Results

The final results comparing several models are shown below:

Model ROC AUC Recall Precision F1 Score
Naive Baseline (no ml) 0.5 3.47% 1.04% 0.016
Logistic Regression 0.577 0.51% 2.91% 0.009
Random Forest Default 0.929 65.2% 14.7% 0.240
Random Forest Tuned for 75% Recall 0.929 75% 8.31% 0.150
Auto-optimized Model 0.927 2.88% 64.4% 0.055
Auto-optimized Model Tuned for 75% Recall 0.927 75% 9.58% 0.170

Final Confusion Matrix

Feature Importances

Notebooks

  1. Partitioning Data: separate data into independent subsets to run operations in parallel.
  2. Prediction Engineering: create labels based on the business need and historical data.
  3. Feature Engineering: implement automated feature engineering workflow using label times and raw data
  4. Feature Engineering on Spark: parallelize feature engineering calculations by distributing across multiple machines
  5. Modeling: develop machine learning algorithms to predict labels from features; use automated genetic search tools to search for best model.

Feature Engineering with Spark

To scale the feature engineering to a large dataset, the data was partitioned and automated feature engineering was run in parallel using Apache Spark with PySpark.

Featuretools supports scaling to multiple cores on one machine natively or to multiple machines using a Dask cluster. However, this approach shows that Spark can also be used to parallelize feature engineering resulting in reduced run times even on large datasets.

The notebook Feature Engineering on Spark demonstrates the procedure. The article Featuretools on Spark documents the approach.

Feature Labs

Featuretools

Featuretools is an open source project created by Feature Labs. To see the other open source projects we're working on visit Feature Labs Open Source. If building impactful data science pipelines is important to you or your business, please get in touch.

Contact

Any questions can be directed to [email protected]

More Repositories

1

featuretools

An open source python library for automated feature engineering
Python
7,242
star
2

evalml

EvalML is an AutoML library written in python.
Python
772
star
3

compose

A machine learning tool for automated prediction engineering. It allows you to easily structure prediction problems and generate labels for supervised learning.
Python
497
star
4

open_source_demos

A collection of demos showcasing automated feature engineering and machine learning in diverse use cases
Jupyter Notebook
496
star
5

Automated-Manual-Comparison

Automated vs Manual Feature Engineering Comparison. Implemented using Featuretools.
Jupyter Notebook
327
star
6

predict-remaining-useful-life

Predict remaining useful life of a component based on historical sensor observations using automated feature engineering
Jupyter Notebook
229
star
7

locust-grasshopper

a load testing tool extended from locust
Python
177
star
8

woodwork

Woodwork is a Python library that provides robust methods for managing and communicating data typing information.
Python
144
star
9

autonormalize

python library for automated dataset normalization
Python
110
star
10

predict-loan-repayment

Predict whether a loan will be repaid using automated feature engineering.
Jupyter Notebook
64
star
11

predict-taxi-trip-duration

Predict taxi trip duration based on historical trips using automated feature engineering
Jupyter Notebook
60
star
12

categorical_encoding

Repository for the research and implementation of categorical encoding into a Featuretools-compatible Python library
Jupyter Notebook
50
star
13

nlp_primitives

Natural Language Processing primitives for Featuretools
Python
37
star
14

featuretools-tsfresh-primitives

TSFresh primitives for featuretools
Python
36
star
15

predict-malicious-cyber-connections

Predict whether internet traffic is malicious given historical router traffic data
Jupyter Notebook
34
star
16

predict-correct-answer

Predict whether a student will correctly answer a problem based on past performance using automated feature engineering
HTML
32
star
17

DSx

Hands on tutorials demonstrating the concepts of Prediction engineering, Feature engineering and automation in data science.
Jupyter Notebook
29
star
18

predict-appointment-noshow

Predict whether or not a patient will show up to their next appointment using automated feature engineering
Jupyter Notebook
29
star
19

predict-olympic-medals

Predict how many medals a country will win at the Olympics based on past performance using automated feature engineering
Jupyter Notebook
29
star
20

snakeplane

A flexible, easy-to-use abstraction layer for building tools for the Alteryx Python SDK
Python
27
star
21

python-sdk-samples

A repository for all sample plugins created with the Alteryx python SDK
Python
25
star
22

predict-household-poverty

Predict the poverty of households in Costa Rica using automated feature engineering.
Jupyter Notebook
23
star
23

AlteryxRhelper

Create, manage and edit R code outside Alteryx in an IDE
R
20
star
24

alteryx-tool-generator

Generator to scaffold a custom Alteryx Designer tool.
JavaScript
18
star
25

DL-DB

Deep learning for time-varying multi-entity datasets
Python
17
star
26

cookbook-alteryx-server

Chef cookbook for Alteryx Server
Ruby
16
star
27

promote-python

Python library for deploying models built using Python to Alteryx Promote.
Python
16
star
28

henchman

A collection of repeated use utility functions for notebook demos.
Python
15
star
29

AlteryxPredictive

This is an R package containing utility functions used by the predictive tools in Alteryx.
R
15
star
30

ayx-developer-sdk

Alteryx Developer Software Development Kit (SDK)
12
star
31

featuretools-sklearn-transformer

Featuretools' DFS as a scikit-learn transformer
Python
11
star
32

sparkGLM

An R-like GLM package for Apache Spark
Scala
10
star
33

featuretools_sql

Automated creation of EntitySets from relational data stored in SQL databases
Python
10
star
34

flightdeck

Interactive Dashboard for Predictive Models
CSS
8
star
35

mini-tate

TypeScript
8
star
36

featuretools-docker

Use docker to provision Featuretools with a Jupyter notebook server
Dockerfile
7
star
37

dev-harness

TypeScript
7
star
38

jeeves

A sagacious valet to build and maintain predictive tools in Alteryx.
R
7
star
39

alteryx-ui

JavaScript
6
star
40

learning-guide

Want to use Alteryx, but not sure where to start? To guide you through your journey, we have provided a comprehensive list of available resources!
HTML
6
star
41

ui-automation-samples

HTML
5
star
42

pythontool-ayx-package

Python
5
star
43

OpenYXDB

C
5
star
44

gh-action-ci

A GitHub Action integrated with the GitHub and CircleCI API.
Python
5
star
45

promote-r-client

R package for deploying models built using R to Alteryx Promote.
R
5
star
46

DLDB-Demos

Jupyter Notebook
5
star
47

premium_primitives

Python
4
star
48

D3M-Online-Retail-Dataset

Convert D3M raw dataset to D3M clean dataset with Featuretools
Python
4
star
49

JavaScriptTool

Alteryx tool to execute arbitrary JavaScript code within the Alteryx workflow.
JavaScript
4
star
50

generator-node-typescript-simple

An opinionated yeoman generator for node packages with typescript. Based on generator-node-typescript.
JavaScript
3
star
51

AlteryxSim

R package for Simulation in Alteryx
R
3
star
52

react-comms

JavaScript
3
star
53

AlteryxPrescriptive

R Package for Optimization in Alteryx
R
3
star
54

alteryx-open-src-update-checker

An add-on for Alteryx open source that automatically checks for the latest updates and warnings you when an Alteryx package is out of date.
Python
3
star
55

gh-action-pypi-upload

GitHub action to upload to PyPi
Shell
2
star
56

AlteryxPythonSdk-teaching-a-spider-to-crawl

Python
2
star
57

ta1-primitives

Python
2
star
58

predict-restaurant-rating

Predict the rating given to a restaurant based solely on the review text. Uses custom NLP primitives.
Jupyter Notebook
2
star
59

Code_for_weekly_challenge

Code used to generate datasets for Alteryx's weekly challenges on the Community
R
1
star
60

adobe-analytics

Generate on demand report data from your Adobe Analytics report suites.
JavaScript
1
star
61

AlteryxAddins

R
1
star
62

GoogleAnalytics

Alteryx Google Analytics Plugin
JavaScript
1
star
63

Logistic_Regression

Logistic Regression Tool
CSS
1
star
64

CheckMates

CheckMate is an AutoML library which catches and warns of problems with your data and problem setup before modeling
Python
1
star