O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Estimators

An estimator is an abstraction of a learning algorithm that fits a model on a dataset.

An estimator implements a fit() method that takes a DataFrame and produces a model. An example of a learning algorithm is LogisticRegression.

In a nutshell, the estimator is: DataFrame =[fit]=> Model.

In the following example, PipelineComponentExample introduces the concepts of transformers and estimators:

import org.apache.spark.ml.classification.LogisticRegression import org.apache.spark.ml.linalg.{Vector, Vectors} import org.apache.spark.ml.param.ParamMap import org.apache.spark.sql.Row import org.utils.StandaloneSpark object PipelineComponentExample {   def main(args: Array[String]): Unit = {  val spark = StandaloneSpark.getSparkInstance() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required