<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=MLlib</id>
	<title>MLlib - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=MLlib"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=MLlib&amp;action=history"/>
	<updated>2026-12-06T00:07:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=MLlib&amp;diff=99&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@f2492a3</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=MLlib&amp;diff=99&amp;oldid=prev"/>
		<updated>2026-11-23T00:34:53Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@f2492a3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                = MLlib&lt;br /&gt;
| developer           = [[Apache Software Foundation]] ([[Apache Spark]] project)&lt;br /&gt;
| initial_release     = Spark 0.8.0 (RDD-based API); &amp;lt;code&amp;gt;spark.ml&amp;lt;/code&amp;gt; previewed in Spark 1.2.0&lt;br /&gt;
| latest_release      = Spark 4.3.0&lt;br /&gt;
| latest_release_date = 2026-10-30&lt;br /&gt;
| written_in          = Scala, with Python, Java and R APIs&lt;br /&gt;
| type                = Machine learning library&lt;br /&gt;
| license             = Apache License 2.0&lt;br /&gt;
| website             = [https://spark.apache.org/docs/4.3.0/ml-guide.html MLlib Main Guide]&lt;br /&gt;
| repo                = [https://github.com/apache/spark/tree/v4.3.0/mllib github.com/apache/spark (mllib/)]&lt;br /&gt;
| related             = [[spark.mllib (RDD-based API)]], [[Apache Spark]], [[Spark Connect]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-22|the v4.3.0 tag of apache/spark (docs/ml-guide.md, docs/ml-migration-guide.md, python/pyspark/ml/util.py, python/pyspark/ml/connect/, sql/connect/server/.../connect/ml/), the Spark 0.8.0, 1.2.0, 2.0.0, 3.5.0 and 4.0.0 release notes, SPARK-50812 and SPARK-50828}}&lt;br /&gt;
{{Status|active |note=MLlib is not deprecated. Its RDD-based &amp;lt;code&amp;gt;spark.mllib&amp;lt;/code&amp;gt; package has been in maintenance mode since Spark 2.0; the DataFrame-based &amp;lt;code&amp;gt;spark.ml&amp;lt;/code&amp;gt; package is the primary API. |ref=&amp;lt;ref name=&amp;quot;guide&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/docs/ml-guide.md |title=MLlib: Main Guide (docs/ml-guide.md at v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MLlib&amp;#039;&amp;#039;&amp;#039; is the machine learning library of [[Apache Spark]]. It provides distributed learning algorithms (classification, regression, clustering, collaborative filtering), feature transformations, ML Pipelines, model persistence and utilities such as linear algebra and statistics.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt; MLlib has two APIs: the DataFrame-based API in the &amp;lt;code&amp;gt;spark.ml&amp;lt;/code&amp;gt; package, which is the primary API, and the older [[RDD]]-based API in the &amp;lt;code&amp;gt;spark.mllib&amp;lt;/code&amp;gt; package, which has been in maintenance mode since Spark 2.0.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt; Neither API, and not MLlib as a whole, is deprecated.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Two APIs ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! &amp;lt;code&amp;gt;spark.ml&amp;lt;/code&amp;gt; (DataFrame-based) !! &amp;lt;code&amp;gt;spark.mllib&amp;lt;/code&amp;gt; (RDD-based)&lt;br /&gt;
|-&lt;br /&gt;
! Status in Spark 4.3.0&lt;br /&gt;
| Primary API; new features go here&lt;br /&gt;
| Maintenance mode since Spark 2.0: bug fixes only, no new features&lt;br /&gt;
|-&lt;br /&gt;
! Data type&lt;br /&gt;
| [[DataFrame]] with feature vector columns&lt;br /&gt;
| [[RDD]] of objects such as &amp;lt;code&amp;gt;LabeledPoint&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Building blocks&lt;br /&gt;
| Estimators, transformers, evaluators and pipelines&lt;br /&gt;
| Algorithm objects with &amp;lt;code&amp;gt;train&amp;lt;/code&amp;gt; methods&lt;br /&gt;
|-&lt;br /&gt;
! Linear algebra types&lt;br /&gt;
| &amp;lt;code&amp;gt;org.apache.spark.ml.linalg&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;org.apache.spark.mllib.linalg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Spark Connect&lt;br /&gt;
| Supported from Spark 4.0.0 (Python)&lt;br /&gt;
| Not supported, because Connect has no RDD API&lt;br /&gt;
|}&lt;br /&gt;
Sources: the MLlib guide and migration guide,&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;migration&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/docs/ml-migration-guide.md |title=Migration Guide: MLlib (docs/ml-migration-guide.md at v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; the Spark Connect overview&amp;lt;ref name=&amp;quot;connect&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/spark-connect-overview.html |title=Spark Connect Overview (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; and SPARK-50812.&amp;lt;ref name=&amp;quot;jira50812&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-50812 |title=SPARK-50812: Support pyspark.ml on Connect |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MLlib guide gives the reasons for the move to DataFrames: a friendlier API, Spark data sources, SQL queries, the Catalyst and Tungsten optimizations, one API across languages, and practical ML Pipelines, especially for feature transformations.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What &amp;quot;Spark ML&amp;quot; means ==&lt;br /&gt;
&amp;quot;Spark ML&amp;quot; is not an official name. The MLlib guide says it is sometimes used for the DataFrame-based API, because of the &amp;lt;code&amp;gt;org.apache.spark.ml&amp;lt;/code&amp;gt; package name and the early term &amp;quot;Spark ML Pipelines&amp;quot;. The official name of the library, covering both APIs, is MLlib.&amp;lt;ref name=&amp;quot;guide&amp;quot; /&amp;gt; In code, &amp;lt;code&amp;gt;pyspark.ml&amp;lt;/code&amp;gt; is the DataFrame-based API and &amp;lt;code&amp;gt;pyspark.mllib&amp;lt;/code&amp;gt; is the RDD-based one.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
MLlib was introduced in Spark 0.8.0 as a library of machine learning and optimization algorithms, developed with the UC Berkeley MLbase project.&amp;lt;ref&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-0-8-0.html |title=Spark Release 0.8.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Spark 1.2.0 previewed a new set of machine learning APIs in a package called &amp;lt;code&amp;gt;spark.ml&amp;lt;/code&amp;gt;, built around learning pipelines and using Spark SQL&amp;#039;s SchemaRDD (the predecessor of the DataFrame) to represent datasets.&amp;lt;ref&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-1-2-0.html |title=Spark Release 1.2.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; In Spark 2.0.0 the DataFrame-based API became the primary API and the RDD-based API entered maintenance mode.&amp;lt;ref name=&amp;quot;r200&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-2-0-0.html |title=Spark Release 2.0.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The Spark 2.x versions of the MLlib guide said the RDD-based API was expected to be removed in Spark 3.0; that sentence was dropped from the guide for the 3.0 release, and the RDD-based API is still part of Spark 4.3.0.&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v2.4.0/docs/ml-guide.md |title=MLlib: Main Guide (docs/ml-guide.md at v2.4.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;jira30934&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-30934 |title=SPARK-30934: ML, GraphX 3.0 QA: Programming guide update and migration guide |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; See [[spark.mllib (RDD-based API)]] for what was removed from that package.&lt;br /&gt;
&lt;br /&gt;
== MLlib and Spark Connect ==&lt;br /&gt;
Spark has had two attempts at machine learning over [[Spark Connect]].&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;pyspark.ml.connect&amp;lt;/code&amp;gt; (Spark 3.5.0).&amp;#039;&amp;#039;&amp;#039; Spark 3.5.0 added a separate package, &amp;lt;code&amp;gt;pyspark.ml.connect&amp;lt;/code&amp;gt;, with its own estimators, transformers, pipelines and cross-validation for Connect clients.&amp;lt;ref&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-3-5-0.html |title=Spark Release 3.5.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; This package was deprecated in Spark 4.0.0 (SPARK-50828); its classes carry a &amp;lt;code&amp;gt;deprecated:: 4.0.0&amp;lt;/code&amp;gt; note at the v4.3.0 tag.&amp;lt;ref name=&amp;quot;jira50828&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-50828 |title=SPARK-50828: Deprecate pyspark.ml.connect |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/python/pyspark/ml/connect/base.py |title=python/pyspark/ml/connect/base.py (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;pyspark.ml&amp;lt;/code&amp;gt; on Connect (Spark 4.0.0).&amp;#039;&amp;#039;&amp;#039; Spark 4.0.0 made the regular &amp;lt;code&amp;gt;pyspark.ml&amp;lt;/code&amp;gt; API work on Spark Connect (SPARK-50812), listed as &amp;quot;ML on Spark Connect&amp;quot; in the release highlights.&amp;lt;ref name=&amp;quot;r400&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-4-0-0.html |title=Spark Release 4.0.0 |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;jira50812&amp;quot; /&amp;gt; When the session is remote, &amp;lt;code&amp;gt;pyspark.ml&amp;lt;/code&amp;gt; sends fit and transform calls to the Connect server, which runs the Scala implementation in its ML handler.&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/python/pyspark/ml/util.py |title=python/pyspark/ml/util.py (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/tree/v4.3.0/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/ml |title=sql/connect/server/.../connect/ml (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The RDD-based &amp;lt;code&amp;gt;spark.mllib&amp;lt;/code&amp;gt; API cannot run over Connect, because Connect does not support RDDs or the &amp;lt;code&amp;gt;SparkContext&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;connect&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A DataFrame-based pipeline in PySpark. The same code runs in a classic session and, from Spark 4.0.0, in a Spark Connect session.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pyspark.ml import Pipeline&lt;br /&gt;
from pyspark.ml.classification import LogisticRegression&lt;br /&gt;
from pyspark.ml.feature import VectorAssembler&lt;br /&gt;
&lt;br /&gt;
train = spark.createDataFrame(&lt;br /&gt;
    [(0.0, 1.1, 0.1), (1.0, 2.0, 1.0), (0.0, 1.3, -0.5), (1.0, 2.2, 1.5)],&lt;br /&gt;
    [&amp;quot;label&amp;quot;, &amp;quot;x1&amp;quot;, &amp;quot;x2&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
pipeline = Pipeline(stages=[&lt;br /&gt;
    VectorAssembler(inputCols=[&amp;quot;x1&amp;quot;, &amp;quot;x2&amp;quot;], outputCol=&amp;quot;features&amp;quot;),&lt;br /&gt;
    LogisticRegression(maxIter=10),&lt;br /&gt;
])&lt;br /&gt;
model = pipeline.fit(train)&lt;br /&gt;
model.transform(train).select(&amp;quot;label&amp;quot;, &amp;quot;prediction&amp;quot;).show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[spark.mllib (RDD-based API)]]&lt;br /&gt;
* [[RDD]]&lt;br /&gt;
* [[Apache Spark]]&lt;br /&gt;
* [[Spark Connect]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>