class TrainClassifier extends Estimator[TrainedClassifierModel] with AutoTrainer[TrainedClassifierModel] with SynapseMLLogging
Trains a classification model. Featurizes the given data into a vector of doubles.
Note the behavior of the reindex and labels parameters, the parameters interact as:
reindex -> false labels -> false (Empty) Assume all double values, don't use metadata, assume natural ordering
reindex -> true labels -> false (Empty) Index, use natural ordering of string indexer
reindex -> false labels -> true (Specified) Assume user knows indexing, apply label values. Currently only string type supported.
reindex -> true labels -> true (Specified) Validate labels matches column type, try to recast to label type, reindex label column
The currently supported classifiers are: Logistic Regression Classifier Decision Tree Classifier Random Forest Classifier Gradient Boosted Trees Classifier Naive Bayes Classifier Multilayer Perceptron Classifier In addition to any generic learner that inherits from Predictor.
- Alphabetic
- By Inheritance
- TrainClassifier
- SynapseMLLogging
- AutoTrainer
- Wrappable
- DotnetWrappable
- RWrappable
- PythonWrappable
- BaseWrappable
- HasFeaturesCol
- ComplexParamsWritable
- MLWritable
- HasInputCols
- HasLabelCol
- Estimator
- PipelineStage
- Logging
- Params
- Serializable
- Serializable
- Identifiable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
clear(param: Param[_]): TrainClassifier.this.type
- Definition Classes
- Params
- def convertLabel(dataset: Dataset[_], labelColumn: String, labelValues: Option[Array[_]]): (DataFrame, Option[Array[_]])
-
def
copy(extra: ParamMap): Estimator[TrainedClassifierModel]
- Definition Classes
- TrainClassifier → Estimator → PipelineStage → Params
-
def
dotnetAdditionalMethods: String
- Definition Classes
- DotnetWrappable
-
def
explainParam(param: Param[_]): String
- Definition Classes
- Params
-
def
explainParams(): String
- Definition Classes
- Params
-
final
def
extractParamMap(): ParamMap
- Definition Classes
- Params
-
final
def
extractParamMap(extra: ParamMap): ParamMap
- Definition Classes
- Params
-
val
featuresCol: Param[String]
The name of the features column
The name of the features column
- Definition Classes
- HasFeaturesCol
-
def
fit(dataset: Dataset[_]): TrainedClassifierModel
Fits the classification model.
Fits the classification model.
- dataset
The input dataset to train.
- returns
The trained classification model.
- Definition Classes
- TrainClassifier → Estimator
-
def
fit(dataset: Dataset[_], paramMaps: Seq[ParamMap]): Seq[TrainedClassifierModel]
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" )
-
def
fit(dataset: Dataset[_], paramMap: ParamMap): TrainedClassifierModel
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" )
-
def
fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): TrainedClassifierModel
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" ) @varargs()
-
final
def
get[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
final
def
getDefault[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getFeaturesCol: String
- Definition Classes
- HasFeaturesCol
- def getFeaturizeParams: (Boolean, Boolean, Int)
-
def
getInputCols: Array[String]
- Definition Classes
- HasInputCols
-
def
getLabelCol: String
- Definition Classes
- HasLabelCol
- def getLabels: Array[String]
-
def
getModel: Estimator[_ <: Model[_]]
- Definition Classes
- AutoTrainer
-
def
getNumFeatures: Int
- Definition Classes
- AutoTrainer
-
final
def
getOrDefault[T](param: Param[T]): T
- Definition Classes
- Params
-
def
getParam(paramName: String): Param[Any]
- Definition Classes
- Params
-
def
getParamInfo(p: Param[_]): ParamInfo[_]
- Definition Classes
- BaseWrappable
- def getReindexLabel: Boolean
-
final
def
hasDefault[T](param: Param[T]): Boolean
- Definition Classes
- Params
-
def
hasParam(paramName: String): Boolean
- Definition Classes
- Params
-
val
inputCols: StringArrayParam
The names of the inputColumns
The names of the inputColumns
- Definition Classes
- HasInputCols
-
final
def
isDefined(param: Param[_]): Boolean
- Definition Classes
- Params
-
final
def
isSet(param: Param[_]): Boolean
- Definition Classes
- Params
-
val
labelCol: Param[String]
The name of the label column
The name of the label column
- Definition Classes
- HasLabelCol
-
val
labels: StringArrayParam
Specifies the labels metadata on the column.
Specifies the labels metadata on the column. See class documentation for how this parameter interacts with reindex labels parameter.
-
def
logClass(featureName: String): Unit
- Definition Classes
- SynapseMLLogging
-
def
logFit[T](f: ⇒ T, columns: Int): T
- Definition Classes
- SynapseMLLogging
-
def
logTransform[T](f: ⇒ T, columns: Int): T
- Definition Classes
- SynapseMLLogging
-
def
logVerb[T](verb: String, f: ⇒ T, columns: Option[Int] = None): T
- Definition Classes
- SynapseMLLogging
-
def
makeDotnetFile(conf: CodegenConfig): Unit
- Definition Classes
- DotnetWrappable
-
def
makePyFile(conf: CodegenConfig): Unit
- Definition Classes
- PythonWrappable
-
def
makeRFile(conf: CodegenConfig): Unit
- Definition Classes
- RWrappable
-
val
model: EstimatorParam
Model to run.
Model to run. See doc on derived classes.
- Definition Classes
- AutoTrainer
-
def
modelDoc: String
Doc for model to run.
Doc for model to run.
- Definition Classes
- TrainClassifier → AutoTrainer
-
val
numFeatures: IntParam
Number of features to hash to
Number of features to hash to
- Definition Classes
- AutoTrainer
-
lazy val
params: Array[Param[_]]
- Definition Classes
- Params
-
def
pyAdditionalMethods: String
- Definition Classes
- PythonWrappable
-
def
pyInitFunc(): String
- Definition Classes
- PythonWrappable
-
val
reindexLabel: BooleanParam
Specifies whether to reindex the given label column.
Specifies whether to reindex the given label column. See class documentation for how this parameter interacts with specified labels.
-
def
save(path: String): Unit
- Definition Classes
- MLWritable
- Annotations
- @Since( "1.6.0" ) @throws( ... )
-
final
def
set[T](param: Param[T], value: T): TrainClassifier.this.type
- Definition Classes
- Params
-
def
setFeaturesCol(value: String): TrainClassifier.this.type
- Definition Classes
- HasFeaturesCol
-
def
setInputCols(value: Array[String]): TrainClassifier.this.type
- Definition Classes
- HasInputCols
-
def
setLabelCol(value: String): TrainClassifier.this.type
- Definition Classes
- HasLabelCol
- def setLabels(value: Array[String]): TrainClassifier.this.type
-
def
setModel(value: Estimator[_ <: Model[_]]): TrainClassifier.this.type
- Definition Classes
- AutoTrainer
-
def
setNumFeatures(value: Int): TrainClassifier.this.type
- Definition Classes
- AutoTrainer
- def setReindexLabel(value: Boolean): TrainClassifier.this.type
-
def
toString(): String
- Definition Classes
- Identifiable → AnyRef → Any
-
def
transformSchema(schema: StructType): StructType
- Definition Classes
- TrainClassifier → PipelineStage
- Annotations
- @DeveloperApi()
-
val
uid: String
- Definition Classes
- TrainClassifier → SynapseMLLogging → Identifiable
-
def
write: MLWriter
- Definition Classes
- ComplexParamsWritable → MLWritable