Scalable Machine Learning with Spark MLlib versus scikit-learn: When Does the Cluster Pay Off

When does a cluster framework pay off for machine learning? The same three models - an ALS recommender, logistic regression and a random forest - are trained with identical hyper-parameters in scikit-learn 1.9.1 (with a NumPy / SciPy ALS) and in Spark MLlib 4.3.0 on 5 nested sizes of MovieLens 32M (125 k to 32.0 M ratings by 200,948 users), with 8 cores and in a 1 / 2 / 4 / 8 core sweep. Every run is a fresh process; start-up, load, fit and prediction time, peak memory and quality on the same test rows are measured, and the data size where Spark becomes faster is computed (measured, or a labelled extrapolation).

NOTE: MovieLens 32M ratings from GroupLens (not shipped; SHA-256 recorded); both libraries and the application ran on one machine on 127.0.0.1 - Spark MLlib in local mode, no multi-node cluster; each measurement is a fresh process with a warm operating-system file cache.

Category: Big Data

Big Data Project BD16 from ProTechSC Academy, with graphical abstract, video demonstration and project guidance.