Class SmileClassifier
java.lang.Object
org.apache.spark.ml.PipelineStage
org.apache.spark.ml.Estimator<SmileClassificationModel>
org.apache.spark.ml.Predictor<org.apache.spark.ml.linalg.Vector, SmileClassifier, SmileClassificationModel>
org.apache.spark.ml.classification.Classifier<org.apache.spark.ml.linalg.Vector, SmileClassifier, SmileClassificationModel>
smile.spark.SmileClassifier
- All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging, org.apache.spark.ml.classification.ClassifierParams, org.apache.spark.ml.param.Params, org.apache.spark.ml.param.shared.HasFeaturesCol, org.apache.spark.ml.param.shared.HasLabelCol, org.apache.spark.ml.param.shared.HasPredictionCol, org.apache.spark.ml.param.shared.HasRawPredictionCol, org.apache.spark.ml.PredictorParams, org.apache.spark.ml.util.Identifiable, org.apache.spark.ml.util.MLWritable
public class SmileClassifier
extends org.apache.spark.ml.classification.Classifier<org.apache.spark.ml.linalg.Vector, SmileClassifier, SmileClassificationModel>
implements org.apache.spark.ml.util.MLWritable
A Spark ML
Estimator that trains a SMILE classification model.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for training a SMILE classifier on double feature arrays.Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with a random UID.SmileClassifier(String uid) Constructor with a custom UID. -
Method Summary
Modifier and TypeMethodDescriptioncopy(org.apache.spark.ml.param.ParamMap extra) intReturns the configured number of classes, or -1 if auto-detected.Returns the trainer function.static SmileClassifierLoads a persisted SmileClassifier from the given path.static org.apache.spark.ml.util.MLReader<SmileClassifier> read()Returns an MLReader instance to load a persisted SmileClassifier.setNumClasses(int numClasses) Sets the number of classes explicitly.setTrainer(SmileClassifier.Trainer trainer) Sets the trainer function.train(org.apache.spark.sql.Dataset<?> dataset) uid()org.apache.spark.ml.util.MLWriterwrite()Methods inherited from class org.apache.spark.ml.classification.Classifier
getNumClasses, getNumClasses$default$2, getRawPredictionCol, org$apache$spark$ml$param$shared$HasRawPredictionCol$_setter_$rawPredictionCol_$eq, rawPredictionCol, setRawPredictionCol, validateAndTransformSchemaMethods inherited from class org.apache.spark.ml.Predictor
featuresCol, featuresDataType, fit, getFeaturesCol, getLabelCol, getPredictionCol, labelCol, org$apache$spark$ml$param$shared$HasFeaturesCol$_setter_$featuresCol_$eq, org$apache$spark$ml$param$shared$HasLabelCol$_setter_$labelCol_$eq, org$apache$spark$ml$param$shared$HasPredictionCol$_setter_$predictionCol_$eq, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchemaMethods inherited from class org.apache.spark.ml.Estimator
estimateModelSize, fit, fit, fit, fitMethods inherited from class org.apache.spark.ml.PipelineStage
$, clear, copyValues, copyValues$default$2, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isDefined, isSet, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, onParamChange, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$ml$param$Params$_setter_$defaultParamMap_$eq, org$apache$spark$ml$param$Params$_setter_$paramMap_$eq, paramMap, params, set, set, set, setDefault, setDefault, toString, transformSchema, withLogContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesCol
featuresCol, getFeaturesCol, org$apache$spark$ml$param$shared$HasFeaturesCol$_setter_$featuresCol_$eqMethods inherited from interface org.apache.spark.ml.param.shared.HasLabelCol
getLabelCol, labelCol, org$apache$spark$ml$param$shared$HasLabelCol$_setter_$labelCol_$eqMethods inherited from interface org.apache.spark.ml.param.shared.HasPredictionCol
getPredictionCol, org$apache$spark$ml$param$shared$HasPredictionCol$_setter_$predictionCol_$eq, predictionColMethods inherited from interface org.apache.spark.ml.util.Identifiable
toStringMethods inherited from interface org.apache.spark.ml.util.MLWritable
saveMethods inherited from interface org.apache.spark.ml.param.Params
$, clear, copyValues, copyValues$default$2, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, org$apache$spark$ml$param$Params$_setter_$defaultParamMap_$eq, org$apache$spark$ml$param$Params$_setter_$paramMap_$eq, paramMap, params, set, set, set, setDefault, setDefault
-
Constructor Details
-
SmileClassifier
public SmileClassifier()Default constructor with a random UID. -
SmileClassifier
Constructor with a custom UID.- Parameters:
uid- the instance UID.
-
-
Method Details
-
uid
- Specified by:
uidin interfaceorg.apache.spark.ml.util.Identifiable
-
getTrainer
Returns the trainer function.- Returns:
- the trainer function.
-
setTrainer
Sets the trainer function.- Parameters:
trainer- the trainer function.- Returns:
- this estimator.
-
getNumClasses
public int getNumClasses()Returns the configured number of classes, or -1 if auto-detected.- Returns:
- the number of classes.
-
setNumClasses
Sets the number of classes explicitly.- Parameters:
numClasses- the number of classes.- Returns:
- this estimator.
-
copy
- Specified by:
copyin interfaceorg.apache.spark.ml.param.Params- Specified by:
copyin classorg.apache.spark.ml.Predictor<org.apache.spark.ml.linalg.Vector, SmileClassifier, SmileClassificationModel>
-
train
- Specified by:
trainin classorg.apache.spark.ml.Predictor<org.apache.spark.ml.linalg.Vector, SmileClassifier, SmileClassificationModel>
-
write
public org.apache.spark.ml.util.MLWriter write()- Specified by:
writein interfaceorg.apache.spark.ml.util.MLWritable
-
read
Returns an MLReader instance to load a persisted SmileClassifier.- Returns:
- the reader.
-
load
Loads a persisted SmileClassifier from the given path.- Parameters:
path- the path.- Returns:
- the loaded estimator.
-