mindsdb/mindsdb:lightwood
Docker image. Learn more here.AI Table
or a predictor
. By querying the model, we’ll predict the
probability of churn for new customers of a telecoms company.
Make sure you have access to a working MindsDB installation, either locally or
at MindsDB Cloud.
If you want to learn how to set up your account at MindsDB Cloud, follow
this guide. Another way is to set up
MindsDB locally using
Docker or
Python.
Let’s get started.
example_db.demo_data.customer_churn
table).files.churn
file as a table. Make sure you replace it with
example_db.demo_data.customer_churn
if you connect the data as a database.files.churn
table.
Column | Description | Data Type | Usage |
---|---|---|---|
CustomerId | The identification number of a customer. | character varying | Feature |
Gender | The gender of a customer. | character varying | Feature |
SeniorCitizen | It indicates whether the customer is a senior citizen (1 ) or not (0 ). | integer | Feature |
Partner | It indicates whether the customer has a partner (Yes ) or not (No ). | character varying | Feature |
Dependents | It indicates whether the customer has dependents (Yes ) or not (No ). | character varying | Feature |
Tenure | Number of months the customer has been staying with the company. | integer | Feature |
PhoneService | It indicates whether the customer has a phone service (Yes ) or not (No ). | character varying | Feature |
MultipleLines | It indicates whether the customer has multiple lines (Yes ) or not (No , No phone service ). | character varying | Feature |
InternetService | Customer’s internet service provider (DSL , Fiber optic , No ). | character varying | Feature |
OnlineSecurity | It indicates whether the customer has online security (Yes ) or not (No , No internet service ). | character varying | Feature |
OnlineBackup | It indicates whether the customer has online backup (Yes ) or not (No , No internet service ). | character varying | Feature |
DeviceProtection | It indicates whether the customer has device protection (Yes ) or not (No , No internet service ). | character varying | Feature |
TechSupport | It indicates whether the customer has tech support (Yes ) or not (No , No internet service ). | character varying | Feature |
StreamingTv | It indicates whether the customer has streaming TV (Yes ) or not (No , No internet service ). | character varying | Feature |
StreamingMovies | It indicates whether the customer has streaming movies (Yes ) or not (No , No internet service ). | character varying | Feature |
Contract | The contract term of the customer (Month-to-month , One year , Two year ). | character varying | Feature |
PaperlessBilling | It indicates whether the customer has paperless billing (Yes ) or not (No ). | character varying | Feature |
PaymentMethod | Customer’s payment method (Electronic check , Mailed check , Bank transfer (automatic) , Credit card (automatic) ). | character varying | Feature |
MonthlyCharges | The monthly charge amount. | money | Feature |
TotalCharges | The total amount charged to the customer. | money | Feature |
Churn | It indicates whether the customer churned (Yes ) or not (No ). | character varying | Label |
CREATE MODEL
statement and specify the
input columns used to train FROM
(features) and what we want to
PREDICT
(labels).
Churn
column, whose
values will be predicted.
complete
, we can start making
predictions!
SELECT
statement lets you make predictions for the label
based on the chosen features.
WHERE
clause. Let’s run another query.
JOIN
.