MultilayerPerceptronClassificationModel (Spark 3.5.5 JavaDoc) (original) (raw)
Object
- org.apache.spark.ml.PipelineStage
- org.apache.spark.ml.Transformer
- org.apache.spark.ml.Model
* * org.apache.spark.ml.PredictionModel<FeaturesType,M>
* * org.apache.spark.ml.classification.ClassificationModel<FeaturesType,M>
* * org.apache.spark.ml.classification.ProbabilisticClassificationModel<Vector,MultilayerPerceptronClassificationModel>
* * org.apache.spark.ml.classification.MultilayerPerceptronClassificationModel
- org.apache.spark.ml.Model
- org.apache.spark.ml.Transformer
All Implemented Interfaces:
java.io.Serializable, org.apache.spark.internal.Logging, ClassifierParams, MultilayerPerceptronParams, ProbabilisticClassifierParams, Params, HasBlockSize, HasFeaturesCol, HasLabelCol, HasMaxIter, HasPredictionCol, HasProbabilityCol, HasRawPredictionCol, HasSeed, HasSolver, HasStepSize, HasThresholds, HasTol, PredictorParams, HasTrainingSummary<MultilayerPerceptronClassificationTrainingSummary>, Identifiable, MLWritable
public class MultilayerPerceptronClassificationModel
extends ProbabilisticClassificationModel<Vector,MultilayerPerceptronClassificationModel>
implements MultilayerPerceptronParams, scala.Serializable, MLWritable, HasTrainingSummary<MultilayerPerceptronClassificationTrainingSummary>
Classification model based on the Multilayer Perceptron. Each layer has sigmoid activation function, output layer has softmax.
param: uid uid param: weights the weights of layers
See Also:
Serialized Form
Nested Class Summary
* ### Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging `org.apache.spark.internal.Logging.SparkShellLoggingFilter`
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method and Description IntParam blockSize() Param for block size for stacking input data in matrices. MultilayerPerceptronClassificationModel copy(ParamMap extra) Creates a copy of this instance with the same UID and some extra params. MultilayerPerceptronClassificationSummary evaluate(Dataset<?> dataset) Evaluates the model on a test dataset. Param<Vector> initialWeights() The initial weights of the model. IntArrayParam layers() Layer sizes including input size and output size. static MultilayerPerceptronClassificationModel load(String path) IntParam maxIter() Param for maximum number of iterations (>= 0). int numClasses() Number of classes (values which the label can take). int numFeatures() Returns the number of features the model was trained on. double predict(Vector features) Predict label for the given features. Vector predictRaw(Vector features) Raw prediction for each possible label. static MLReader<MultilayerPerceptronClassificationModel> read() LongParam seed() Param for random seed. Param solver() The solver algorithm for optimization. DoubleParam stepSize() Param for Step size to be used for each iteration of optimization (> 0). MultilayerPerceptronClassificationTrainingSummary summary() Gets summary of model on training set. DoubleParam tol() Param for the convergence tolerance for iterative algorithms (>= 0). String toString() String uid() An immutable unique ID for the object and its derivatives. Vector weights() MLWriter write() Returns an MLWriter instance for this ML instance. * ### Methods inherited from class org.apache.spark.ml.classification.[ProbabilisticClassificationModel](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html "class in org.apache.spark.ml.classification") `[normalizeToProbabilitiesInPlace](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#normalizeToProbabilitiesInPlace-org.apache.spark.ml.linalg.DenseVector-), [predictProbability](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#predictProbability-FeaturesType-), [probabilityCol](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#probabilityCol--), [setProbabilityCol](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#setProbabilityCol-java.lang.String-), [setThresholds](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#setThresholds-double:A-), [thresholds](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#thresholds--), [transform](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#transform-org.apache.spark.sql.Dataset-), [transformSchema](../../../../../org/apache/spark/ml/classification/ProbabilisticClassificationModel.html#transformSchema-org.apache.spark.sql.types.StructType-)` * ### Methods inherited from class org.apache.spark.ml.classification.[ClassificationModel](../../../../../org/apache/spark/ml/classification/ClassificationModel.html "class in org.apache.spark.ml.classification") `[rawPredictionCol](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#rawPredictionCol--), [setRawPredictionCol](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#setRawPredictionCol-java.lang.String-), [transformImpl](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#transformImpl-org.apache.spark.sql.Dataset-)` * ### Methods inherited from class org.apache.spark.ml.[PredictionModel](../../../../../org/apache/spark/ml/PredictionModel.html "class in org.apache.spark.ml") `[featuresCol](../../../../../org/apache/spark/ml/PredictionModel.html#featuresCol--), [labelCol](../../../../../org/apache/spark/ml/PredictionModel.html#labelCol--), [predictionCol](../../../../../org/apache/spark/ml/PredictionModel.html#predictionCol--), [setFeaturesCol](../../../../../org/apache/spark/ml/PredictionModel.html#setFeaturesCol-java.lang.String-), [setPredictionCol](../../../../../org/apache/spark/ml/PredictionModel.html#setPredictionCol-java.lang.String-)` * ### Methods inherited from class org.apache.spark.ml.[Model](../../../../../org/apache/spark/ml/Model.html "class in org.apache.spark.ml") `[hasParent](../../../../../org/apache/spark/ml/Model.html#hasParent--), [parent](../../../../../org/apache/spark/ml/Model.html#parent--), [setParent](../../../../../org/apache/spark/ml/Model.html#setParent-org.apache.spark.ml.Estimator-)` * ### Methods inherited from class org.apache.spark.ml.[Transformer](../../../../../org/apache/spark/ml/Transformer.html "class in org.apache.spark.ml") `[transform](../../../../../org/apache/spark/ml/Transformer.html#transform-org.apache.spark.sql.Dataset-org.apache.spark.ml.param.ParamMap-), [transform](../../../../../org/apache/spark/ml/Transformer.html#transform-org.apache.spark.sql.Dataset-org.apache.spark.ml.param.ParamPair-org.apache.spark.ml.param.ParamPair...-), [transform](../../../../../org/apache/spark/ml/Transformer.html#transform-org.apache.spark.sql.Dataset-org.apache.spark.ml.param.ParamPair-scala.collection.Seq-)` * ### Methods inherited from class org.apache.spark.ml.[PipelineStage](../../../../../org/apache/spark/ml/PipelineStage.html "class in org.apache.spark.ml") `[params](../../../../../org/apache/spark/ml/PipelineStage.html#params--)` * ### Methods inherited from class Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait` * ### Methods inherited from interface org.apache.spark.ml.classification.[MultilayerPerceptronParams](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html "interface in org.apache.spark.ml.classification") `[getInitialWeights](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html#getInitialWeights--), [getLayers](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html#getLayers--)` * ### Methods inherited from interface org.apache.spark.ml.classification.[ProbabilisticClassifierParams](../../../../../org/apache/spark/ml/classification/ProbabilisticClassifierParams.html "interface in org.apache.spark.ml.classification") `[validateAndTransformSchema](../../../../../org/apache/spark/ml/classification/ProbabilisticClassifierParams.html#validateAndTransformSchema-org.apache.spark.sql.types.StructType-boolean-org.apache.spark.sql.types.DataType-)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasLabelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html "interface in org.apache.spark.ml.param.shared") `[getLabelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html#getLabelCol--), [labelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html#labelCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasFeaturesCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html "interface in org.apache.spark.ml.param.shared") `[featuresCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html#featuresCol--), [getFeaturesCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html#getFeaturesCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html "interface in org.apache.spark.ml.param.shared") `[getPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html#getPredictionCol--), [predictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html#predictionCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.[Params](../../../../../org/apache/spark/ml/param/Params.html "interface in org.apache.spark.ml.param") `[clear](../../../../../org/apache/spark/ml/param/Params.html#clear-org.apache.spark.ml.param.Param-), [copyValues](../../../../../org/apache/spark/ml/param/Params.html#copyValues-T-org.apache.spark.ml.param.ParamMap-), [defaultCopy](../../../../../org/apache/spark/ml/param/Params.html#defaultCopy-org.apache.spark.ml.param.ParamMap-), [defaultParamMap](../../../../../org/apache/spark/ml/param/Params.html#defaultParamMap--), [explainParam](../../../../../org/apache/spark/ml/param/Params.html#explainParam-org.apache.spark.ml.param.Param-), [explainParams](../../../../../org/apache/spark/ml/param/Params.html#explainParams--), [extractParamMap](../../../../../org/apache/spark/ml/param/Params.html#extractParamMap--), [extractParamMap](../../../../../org/apache/spark/ml/param/Params.html#extractParamMap-org.apache.spark.ml.param.ParamMap-), [get](../../../../../org/apache/spark/ml/param/Params.html#get-org.apache.spark.ml.param.Param-), [getDefault](../../../../../org/apache/spark/ml/param/Params.html#getDefault-org.apache.spark.ml.param.Param-), [getOrDefault](../../../../../org/apache/spark/ml/param/Params.html#getOrDefault-org.apache.spark.ml.param.Param-), [getParam](../../../../../org/apache/spark/ml/param/Params.html#getParam-java.lang.String-), [hasDefault](../../../../../org/apache/spark/ml/param/Params.html#hasDefault-org.apache.spark.ml.param.Param-), [hasParam](../../../../../org/apache/spark/ml/param/Params.html#hasParam-java.lang.String-), [isDefined](../../../../../org/apache/spark/ml/param/Params.html#isDefined-org.apache.spark.ml.param.Param-), [isSet](../../../../../org/apache/spark/ml/param/Params.html#isSet-org.apache.spark.ml.param.Param-), [onParamChange](../../../../../org/apache/spark/ml/param/Params.html#onParamChange-org.apache.spark.ml.param.Param-), [paramMap](../../../../../org/apache/spark/ml/param/Params.html#paramMap--), [params](../../../../../org/apache/spark/ml/param/Params.html#params--), [set](../../../../../org/apache/spark/ml/param/Params.html#set-org.apache.spark.ml.param.Param-T-), [set](../../../../../org/apache/spark/ml/param/Params.html#set-org.apache.spark.ml.param.ParamPair-), [set](../../../../../org/apache/spark/ml/param/Params.html#set-java.lang.String-java.lang.Object-), [setDefault](../../../../../org/apache/spark/ml/param/Params.html#setDefault-org.apache.spark.ml.param.Param-T-), [setDefault](../../../../../org/apache/spark/ml/param/Params.html#setDefault-scala.collection.Seq-), [shouldOwn](../../../../../org/apache/spark/ml/param/Params.html#shouldOwn-org.apache.spark.ml.param.Param-)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasRawPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasRawPredictionCol.html "interface in org.apache.spark.ml.param.shared") `[getRawPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasRawPredictionCol.html#getRawPredictionCol--), [rawPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasRawPredictionCol.html#rawPredictionCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasProbabilityCol](../../../../../org/apache/spark/ml/param/shared/HasProbabilityCol.html "interface in org.apache.spark.ml.param.shared") `[getProbabilityCol](../../../../../org/apache/spark/ml/param/shared/HasProbabilityCol.html#getProbabilityCol--), [probabilityCol](../../../../../org/apache/spark/ml/param/shared/HasProbabilityCol.html#probabilityCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasThresholds](../../../../../org/apache/spark/ml/param/shared/HasThresholds.html "interface in org.apache.spark.ml.param.shared") `[getThresholds](../../../../../org/apache/spark/ml/param/shared/HasThresholds.html#getThresholds--), [thresholds](../../../../../org/apache/spark/ml/param/shared/HasThresholds.html#thresholds--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html "interface in org.apache.spark.ml.param.shared") `[getSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html#getSeed--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasMaxIter](../../../../../org/apache/spark/ml/param/shared/HasMaxIter.html "interface in org.apache.spark.ml.param.shared") `[getMaxIter](../../../../../org/apache/spark/ml/param/shared/HasMaxIter.html#getMaxIter--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasTol](../../../../../org/apache/spark/ml/param/shared/HasTol.html "interface in org.apache.spark.ml.param.shared") `[getTol](../../../../../org/apache/spark/ml/param/shared/HasTol.html#getTol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasStepSize](../../../../../org/apache/spark/ml/param/shared/HasStepSize.html "interface in org.apache.spark.ml.param.shared") `[getStepSize](../../../../../org/apache/spark/ml/param/shared/HasStepSize.html#getStepSize--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasSolver](../../../../../org/apache/spark/ml/param/shared/HasSolver.html "interface in org.apache.spark.ml.param.shared") `[getSolver](../../../../../org/apache/spark/ml/param/shared/HasSolver.html#getSolver--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasBlockSize](../../../../../org/apache/spark/ml/param/shared/HasBlockSize.html "interface in org.apache.spark.ml.param.shared") `[getBlockSize](../../../../../org/apache/spark/ml/param/shared/HasBlockSize.html#getBlockSize--)` * ### Methods inherited from interface org.apache.spark.ml.util.[MLWritable](../../../../../org/apache/spark/ml/util/MLWritable.html "interface in org.apache.spark.ml.util") `[save](../../../../../org/apache/spark/ml/util/MLWritable.html#save-java.lang.String-)` * ### Methods inherited from interface org.apache.spark.ml.util.[HasTrainingSummary](../../../../../org/apache/spark/ml/util/HasTrainingSummary.html "interface in org.apache.spark.ml.util") `[hasSummary](../../../../../org/apache/spark/ml/util/HasTrainingSummary.html#hasSummary--), [setSummary](../../../../../org/apache/spark/ml/util/HasTrainingSummary.html#setSummary-scala.Option-)` * ### Methods inherited from interface org.apache.spark.internal.Logging `$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitialize`
Method Detail
* #### read public static [MLReader](../../../../../org/apache/spark/ml/util/MLReader.html "class in org.apache.spark.ml.util")<[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")> read() * #### load public static [MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification") load(String path) * #### layers public final [IntArrayParam](../../../../../org/apache/spark/ml/param/IntArrayParam.html "class in org.apache.spark.ml.param") layers() Layer sizes including input size and output size. Specified by: `[layers](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html#layers--)` in interface `[MultilayerPerceptronParams](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### solver public final [Param](../../../../../org/apache/spark/ml/param/Param.html "class in org.apache.spark.ml.param")<String> solver() The solver algorithm for optimization. Supported options: "gd" (minibatch gradient descent) or "l-bfgs". Default: "l-bfgs" Specified by: `[solver](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html#solver--)` in interface `[MultilayerPerceptronParams](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html "interface in org.apache.spark.ml.classification")` Specified by: `[solver](../../../../../org/apache/spark/ml/param/shared/HasSolver.html#solver--)` in interface `[HasSolver](../../../../../org/apache/spark/ml/param/shared/HasSolver.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### initialWeights public final [Param](../../../../../org/apache/spark/ml/param/Param.html "class in org.apache.spark.ml.param")<[Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg")> initialWeights() The initial weights of the model. Specified by: `[initialWeights](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html#initialWeights--)` in interface `[MultilayerPerceptronParams](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronParams.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### blockSize public final [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") blockSize() Param for block size for stacking input data in matrices. Data is stacked within partitions. If block size is more than remaining data in a partition then it is adjusted to the size of this data.. Specified by: `[blockSize](../../../../../org/apache/spark/ml/param/shared/HasBlockSize.html#blockSize--)` in interface `[HasBlockSize](../../../../../org/apache/spark/ml/param/shared/HasBlockSize.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### stepSize public [DoubleParam](../../../../../org/apache/spark/ml/param/DoubleParam.html "class in org.apache.spark.ml.param") stepSize() Description copied from interface: `[HasStepSize](../../../../../org/apache/spark/ml/param/shared/HasStepSize.html#stepSize--)` Param for Step size to be used for each iteration of optimization (> 0). Specified by: `[stepSize](../../../../../org/apache/spark/ml/param/shared/HasStepSize.html#stepSize--)` in interface `[HasStepSize](../../../../../org/apache/spark/ml/param/shared/HasStepSize.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### tol public final [DoubleParam](../../../../../org/apache/spark/ml/param/DoubleParam.html "class in org.apache.spark.ml.param") tol() Description copied from interface: `[HasTol](../../../../../org/apache/spark/ml/param/shared/HasTol.html#tol--)` Param for the convergence tolerance for iterative algorithms (>= 0). Specified by: `[tol](../../../../../org/apache/spark/ml/param/shared/HasTol.html#tol--)` in interface `[HasTol](../../../../../org/apache/spark/ml/param/shared/HasTol.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### maxIter public final [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") maxIter() Description copied from interface: `[HasMaxIter](../../../../../org/apache/spark/ml/param/shared/HasMaxIter.html#maxIter--)` Param for maximum number of iterations (>= 0). Specified by: `[maxIter](../../../../../org/apache/spark/ml/param/shared/HasMaxIter.html#maxIter--)` in interface `[HasMaxIter](../../../../../org/apache/spark/ml/param/shared/HasMaxIter.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### seed public final [LongParam](../../../../../org/apache/spark/ml/param/LongParam.html "class in org.apache.spark.ml.param") seed() Description copied from interface: `[HasSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html#seed--)` Param for random seed. Specified by: `[seed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html#seed--)` in interface `[HasSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html "interface in org.apache.spark.ml.param.shared")` Returns: (undocumented) * #### uid public String uid() An immutable unique ID for the object and its derivatives. Specified by: `[uid](../../../../../org/apache/spark/ml/util/Identifiable.html#uid--)` in interface `[Identifiable](../../../../../org/apache/spark/ml/util/Identifiable.html "interface in org.apache.spark.ml.util")` Returns: (undocumented) * #### weights public [Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg") weights() * #### numFeatures public int numFeatures() Returns the number of features the model was trained on. If unknown, returns -1 Overrides: `[numFeatures](../../../../../org/apache/spark/ml/PredictionModel.html#numFeatures--)` in class `[PredictionModel](../../../../../org/apache/spark/ml/PredictionModel.html "class in org.apache.spark.ml")<[Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg"),[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")>` * #### summary public [MultilayerPerceptronClassificationTrainingSummary](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationTrainingSummary.html "interface in org.apache.spark.ml.classification") summary() Gets summary of model on training set. An exception is thrown if `hasSummary` is false. Specified by: `[summary](../../../../../org/apache/spark/ml/util/HasTrainingSummary.html#summary--)` in interface `[HasTrainingSummary](../../../../../org/apache/spark/ml/util/HasTrainingSummary.html "interface in org.apache.spark.ml.util")<[MultilayerPerceptronClassificationTrainingSummary](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationTrainingSummary.html "interface in org.apache.spark.ml.classification")>` Returns: (undocumented) * #### evaluate public [MultilayerPerceptronClassificationSummary](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationSummary.html "interface in org.apache.spark.ml.classification") evaluate([Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<?> dataset) Evaluates the model on a test dataset. Parameters: `dataset` \- Test dataset to evaluate model on. Returns: (undocumented) * #### predict public double predict([Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg") features) Predict label for the given features. This internal method is used to implement `transform()` and output `predictionCol`. Overrides: `[predict](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#predict-FeaturesType-)` in class `[ClassificationModel](../../../../../org/apache/spark/ml/classification/ClassificationModel.html "class in org.apache.spark.ml.classification")<[Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg"),[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")>` Parameters: `features` \- (undocumented) Returns: (undocumented) * #### copy public [MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification") copy([ParamMap](../../../../../org/apache/spark/ml/param/ParamMap.html "class in org.apache.spark.ml.param") extra) Description copied from interface: `[Params](../../../../../org/apache/spark/ml/param/Params.html#copy-org.apache.spark.ml.param.ParamMap-)` Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly. See `defaultCopy()`. Specified by: `[copy](../../../../../org/apache/spark/ml/param/Params.html#copy-org.apache.spark.ml.param.ParamMap-)` in interface `[Params](../../../../../org/apache/spark/ml/param/Params.html "interface in org.apache.spark.ml.param")` Specified by: `[copy](../../../../../org/apache/spark/ml/Model.html#copy-org.apache.spark.ml.param.ParamMap-)` in class `[Model](../../../../../org/apache/spark/ml/Model.html "class in org.apache.spark.ml")<[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")>` Parameters: `extra` \- (undocumented) Returns: (undocumented) * #### write public [MLWriter](../../../../../org/apache/spark/ml/util/MLWriter.html "class in org.apache.spark.ml.util") write() Description copied from interface: `[MLWritable](../../../../../org/apache/spark/ml/util/MLWritable.html#write--)` Returns an `MLWriter` instance for this ML instance. Specified by: `[write](../../../../../org/apache/spark/ml/util/MLWritable.html#write--)` in interface `[MLWritable](../../../../../org/apache/spark/ml/util/MLWritable.html "interface in org.apache.spark.ml.util")` Returns: (undocumented) * #### predictRaw public [Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg") predictRaw([Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg") features) Raw prediction for each possible label. The meaning of a "raw" prediction may vary between algorithms, but it intuitively gives a measure of confidence in each possible label (where larger = more confident). This internal method is used to implement `transform()` and output `rawPredictionCol`. Specified by: `[predictRaw](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#predictRaw-FeaturesType-)` in class `[ClassificationModel](../../../../../org/apache/spark/ml/classification/ClassificationModel.html "class in org.apache.spark.ml.classification")<[Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg"),[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")>` Parameters: `features` \- (undocumented) Returns: vector where element i is the raw prediction for label i. This raw prediction may be any real number, where a larger value indicates greater confidence for that label. * #### numClasses public int numClasses() Number of classes (values which the label can take). Specified by: `[numClasses](../../../../../org/apache/spark/ml/classification/ClassificationModel.html#numClasses--)` in class `[ClassificationModel](../../../../../org/apache/spark/ml/classification/ClassificationModel.html "class in org.apache.spark.ml.classification")<[Vector](../../../../../org/apache/spark/ml/linalg/Vector.html "interface in org.apache.spark.ml.linalg"),[MultilayerPerceptronClassificationModel](../../../../../org/apache/spark/ml/classification/MultilayerPerceptronClassificationModel.html "class in org.apache.spark.ml.classification")>` * #### toString public String toString() Specified by: `[toString](../../../../../org/apache/spark/ml/util/Identifiable.html#toString--)` in interface `[Identifiable](../../../../../org/apache/spark/ml/util/Identifiable.html "interface in org.apache.spark.ml.util")` Overrides: `toString` in class `Object`