Predictive Analytics Clustering Survival CLV API
K-means and DBSCAN clustering, PCA, CART and random-forest importance, Kaplan-Meier and Cox survival, cohort retention, RFM segments, BG/NBD CLV, market-basket rules, PELT changepoints, classification metrics, correlations and propensity-score matching — pure computation on the numbers you send.
Lloyd k-means with k-means++ seeding, optional standardisation, nInit restarts, silhouette and inertia for a k range, and stable label renumbering.
Density-based clustering with Euclidean or haversine distance, core/border/noise labelling, and an optional k-distance knee suggestion for eps.
Centre (and optionally standardise) columns, decompose the covariance, and return eigenvalues, explained ratios, signed loadings and optional scores.
Fit a classification or regression CART tree with depth and leaf limits, readable rules, feature importance and optional predictions.
Train a small seeded random forest, report out-of-bag accuracy or R², and estimate permutation feature importance with Fisher-Yates shuffles.
Estimate group Kaplan-Meier curves with Greenwood log-log confidence intervals, median survival, survival at chosen times, and a multi-group log-rank test.
Maximise the Cox partial likelihood with Efron or Breslow ties, return hazard ratios with SEs, concordance, and a rank-time proportional-hazards check.
Build day/week/month cohort retention in classic or rolling mode from signup and activity dates, with partial-period flags and a size-weighted curve.
Score customers 1–bins on recency, frequency and monetary value with average ranks for ties, then map scores to Champions/Loyal/New/At risk/Hibernating or a custom rule list.
Fit BG/NBD purchase frequency and Gamma-Gamma spend models, then return P(alive), expected purchases over a horizon, expected value and undiscounted CLV per customer.
Mine frequent itemsets and association rules with support, confidence, lift, leverage and conviction from caller baskets.
Detect mean or mean-variance changepoints with PELT, BIC/AIC or custom penalties, and MAD-based noise scaling.
Compute ROC-AUC, average precision, Brier score, confusion at a threshold, Youden-optimal threshold and equal-width calibration bins from binary labels and scores.
Pairwise Pearson/Spearman/Kendall correlations with p-values, optional partial correlations, and Holm/BH/Bonferroni adjustment across pair-method tests.
Fit logistic propensity scores, match treated to controls 1:1 on the logit within a caliper, and report SMD balance and common-support counts.