官术网_书友最值得收藏!

The estimator algorithm

An estimator is another algorithm that can produce a transformer by fitting on a DataFrame. For instance, a learning algorithm can train on a dataset and produce a model. This produces a transformer by learning an algorithm. It uses the fit() method to produce a transformer. For instance, the Na?ve Bayes learning algorithm is an estimator that calls the fit() method and trains a Na?ve Bayes model, which is a transformer. We will use the following code to train the model:

import org.apache.spark.ml.classification.NaiveBayes

val nb = new NaiveBayes().setModelType("multinomial")

val model = nb.fit(Training_DataDF)
主站蜘蛛池模板: 蓬溪县| 澄江县| 和田县| 宜良县| 镇安县| 新竹县| 昔阳县| 肇东市| 扬州市| 临城县| 江华| 晋宁县| 霞浦县| 安庆市| 聂拉木县| 惠州市| 浦江县| 砚山县| 洪洞县| 浦县| 曲阳县| 东阿县| 时尚| 武汉市| 镇康县| 广河县| 达拉特旗| 永州市| 香格里拉县| 山阳县| 玛沁县| 类乌齐县| 资中县| 郯城县| 胶南市| 南阳市| 舞阳县| 庐江县| 广灵县| 迁西县| 唐海县|