An example demonstrating AFTSurvivalRegression.
An example demonstrating ALS.
An example demonstrating ALS. Run with
bin/run-example ml.ALSExample
An example demonstrating bisecting k-means clustering.
An example demonstrating bisecting k-means clustering. Run with
bin/run-example ml.BisectingKMeansExample
An example of how to use org.apache.spark.sql.DataFrame for ML.
An example of how to use org.apache.spark.sql.DataFrame for ML. Run with
./bin/run-example ml.DataFrameExample [options]
If you use it as a template to create your own app, please use spark-submit
to submit your app.
An example runner for decision trees.
An example runner for decision trees. Run with
./bin/run-example ml.DecisionTreeExample [options]
Note that Decision Trees can take a large amount of memory. If the run-example command above fails, try running via spark-submit and specifying the amount of memory as at least 1g. For local mode, run
./bin/spark-submit --class org.apache.spark.examples.ml.DecisionTreeExample --driver-memory 1g [examples JAR path] [options]
If you use it as a template to create your own app, please use spark-submit
to submit your app.
A simple example demonstrating how to write your own learning algorithm using Estimator, Transformer, and other abstractions.
A simple example demonstrating how to write your own learning algorithm using Estimator, Transformer, and other abstractions. This mimics org.apache.spark.ml.classification.LogisticRegression. Run with
bin/run-example ml.DeveloperApiExample
An example runner for decision trees.
An example runner for decision trees. Run with
./bin/run-example ml.GBTExample [options]
Decision Trees and ensembles can take a large amount of memory. If the run-example command above fails, try running via spark-submit and specifying the amount of memory as at least 1g. For local mode, run
./bin/spark-submit --class org.apache.spark.examples.ml.GBTExample --driver-memory 1g [examples JAR path] [options]
If you use it as a template to create your own app, please use spark-submit
to submit your app.
An example demonstrating Gaussian Mixture Model (GMM).
An example demonstrating Gaussian Mixture Model (GMM). Run with
bin/run-example ml.GaussianMixtureExample
An example demonstrating generalized linear regression.
An example demonstrating generalized linear regression. Run with
bin/run-example ml.GeneralizedLinearRegressionExample
An example demonstrating Isotonic Regression.
An example demonstrating Isotonic Regression. Run with
bin/run-example ml.IsotonicRegressionExample
An example demonstrating k-means clustering.
An example demonstrating k-means clustering. Run with
bin/run-example ml.KMeansExample
An example demonstrating LDA.
An example demonstrating LDA. Run with
bin/run-example ml.LDAExample
An example runner for linear regression with elastic-net (mixing L1/L2) regularization.
An example runner for linear regression with elastic-net (mixing L1/L2) regularization. Run with
bin/run-example ml.LinearRegressionExample [options]
A synthetic dataset can be found at data/mllib/sample_linear_regression_data.txt
which can be
trained by
bin/run-example ml.LinearRegressionExample --regParam 0.15 --elasticNetParam 1.0 \ data/mllib/sample_linear_regression_data.txt
If you use it as a template to create your own app, please use spark-submit
to submit your app.
An example runner for logistic regression with elastic-net (mixing L1/L2) regularization.
An example runner for logistic regression with elastic-net (mixing L1/L2) regularization. Run with
bin/run-example ml.LogisticRegressionExample [options]
A synthetic dataset can be found at data/mllib/sample_libsvm_data.txt
which can be
trained by
bin/run-example ml.LogisticRegressionExample --regParam 0.3 --elasticNetParam 0.8 \ data/mllib/sample_libsvm_data.txt
If you use it as a template to create your own app, please use spark-submit
to submit your app.
A simple example demonstrating model selection using CrossValidator.
A simple example demonstrating model selection using CrossValidator. This example also demonstrates how Pipelines are Estimators.
Run with
bin/run-example ml.ModelSelectionViaCrossValidationExample
A simple example demonstrating model selection using TrainValidationSplit.
A simple example demonstrating model selection using TrainValidationSplit.
Run with
bin/run-example ml.ModelSelectionViaTrainValidationSplitExample
An example for Multilayer Perceptron Classification.
An example of Multiclass to Binary Reduction with One Vs Rest, using Logistic Regression as the base classifier.
An example of Multiclass to Binary Reduction with One Vs Rest, using Logistic Regression as the base classifier. Run with
./bin/run-example ml.OneVsRestExample
An example runner for decision trees.
An example runner for decision trees. Run with
./bin/run-example ml.RandomForestExample [options]
Decision Trees and ensembles can take a large amount of memory. If the run-example command above fails, try running via spark-submit and specifying the amount of memory as at least 1g. For local mode, run
./bin/spark-submit --class org.apache.spark.examples.ml.RandomForestExample --driver-memory 1g [examples JAR path] [options]
If you use it as a template to create your own app, please use spark-submit
to submit your app.
An example demonstrating creating a custom org.apache.spark.ml.Transformer using the UnaryTransformer abstraction.
An example demonstrating creating a custom org.apache.spark.ml.Transformer using the UnaryTransformer abstraction.
Run with
bin/run-example ml.UnaryTransformerExample
An example demonstrating AFTSurvivalRegression. Run with