Spark ML · Browser-native intelligence

Customer Churn Command Center

Train a real Spark ML logistic-regression classifier on 900 customers, score the next batch, and explore threshold economics—entirely inside this tab.
loading 67 MB engine…
Accuracy
Precision
Recall
F1 score
ROC AUC
Customers flagged

ROC performance

threshold independent

Confusion matrix

live threshold

Risk score distribution

stayedchurned

Learned feature influence

model coefficients

Decision landscape

usage drop vs probability

Highest-risk customers

batch predictions
CustomerRiskActionObservedStrongest signal

Equivalent PySpark pipeline

copy-ready
# The browser calls the same spark-ml estimator compiled to WASM
from pyspark.ml import Pipeline
from pyspark.ml.feature import VectorAssembler, StandardScaler
from pyspark.ml.classification import LogisticRegression

assembler = VectorAssembler(inputCols=["tenure", "monthly_spend", "support_calls", "usage_drop", "late_payments"], outputCol="features")
scaler = StandardScaler(inputCol="features", outputCol="scaled", withMean=True, withStd=True)
lr = LogisticRegression(featuresCol="scaled", labelCol="churned", maxIter=800, threshold=0.50)
model = Pipeline(stages=[assembler, scaler, lr]).fit(train_df)
predictions = model.transform(customer_batch)
predictions.select("customer_id", "probability", "prediction").show()
Algorithm spark_ml::LogisticRegressionTraining rows WASM fit time