Use Cases All Data Scientist Should Learn - 2

UseCase#3-Customer Churn Prediction

This scenario could profit from a family of machine learning algorithms. This query is also comparable to the credit card fraud detection query. We want to collect features about the consumers with a predefined label, precisely churn or no-churn.

You can practice Random Forest again or a complex algorithm, for illustration, XGBoost . This situation is, accordingly, a classification problem, which is practicing supervised learning.

We will be prognosticating customer churn for users on a website to purchase a product or many products.

Here are desirable characteristics you could employ in your XGBoost algorithm:

  • login measure
  • date highlights (month, day, etc.)
  • location
  • age
  • product records
  • product heterogeneity
  • the extent of product use
  • regularity of product use
  • login time
  • amount customer emailed consumer service
  • amount client conversed with a chatbot
  • if they mentioned the product

These characteristics can designate if someone is more prominent of a life-long user versus a short-time . Unique features like referral will undoubtedly prove if they like the output.

Product diversity could go each way in the classification if they ordered four separate products but did or did not apply them added times.

Here is sample code to execute once you have your inputs and features ready:

xgb = XGBClassifier() xgb.fit(X_train, y_train) pred = xgb.predict(X_test)

UseCase#4-Sales Forecasting

Possibly the most diverse from the preceding three use cases are forecasting transactions . In this sample, we can use deep learning to predict future purchases of a commodity.

The algorithm used is named LSTM , which is for Long Short-Term Memory.

Here are desirable points you could practice in your LSTM algorithm:

  • date
  • products
  • retailer
  • sales outlay

Here is the execution of code to use with your input data and features:

lstm= Sequential() lstm.add(LSTM(4, batch_input_shape=(1, X_train.shape[1], X_train.shape[2]))) lstm.add(Dense(1)) lstm.compile(loss=‘mean_squared_error’) lstm.fit(X_train, y_train) preds = lstm.predict(X_test)