Packages

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.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TrainClassifier
  2. SynapseMLLogging
  3. AutoTrainer
  4. Wrappable
  5. RWrappable
  6. PythonWrappable
  7. BaseWrappable
  8. HasFeaturesCol
  9. ComplexParamsWritable
  10. MLWritable
  11. HasInputCols
  12. HasLabelCol
  13. Estimator
  14. PipelineStage
  15. Logging
  16. Params
  17. Serializable
  18. Serializable
  19. Identifiable
  20. AnyRef
  21. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TrainClassifier()
  2. new TrainClassifier(uid: String)

Value Members

  1. final def clear(param: Param[_]): TrainClassifier.this.type
    Definition Classes
    Params
  2. def convertLabel(dataset: Dataset[_], labelColumn: String, labelValues: Option[Array[_]]): (DataFrame, Option[Array[_]])
  3. def copy(extra: ParamMap): Estimator[TrainedClassifierModel]
    Definition Classes
    TrainClassifier → Estimator → PipelineStage → Params
  4. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  5. def explainParams(): String
    Definition Classes
    Params
  6. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  7. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  8. val featuresCol: Param[String]

    The name of the features column

    The name of the features column

    Definition Classes
    HasFeaturesCol
  9. 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
  10. def fit(dataset: Dataset[_], paramMaps: Seq[ParamMap]): Seq[TrainedClassifierModel]
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  11. def fit(dataset: Dataset[_], paramMap: ParamMap): TrainedClassifierModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  12. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): TrainedClassifierModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  13. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  14. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  15. def getFeaturesCol: String

    Definition Classes
    HasFeaturesCol
  16. def getFeaturizeParams: (Boolean, Boolean, Int)
  17. def getInputCols: Array[String]

    Definition Classes
    HasInputCols
  18. def getLabelCol: String

    Definition Classes
    HasLabelCol
  19. def getLabels: Array[String]

  20. def getModel: Estimator[_ <: Model[_]]

    Definition Classes
    AutoTrainer
  21. def getNumFeatures: Int

    Definition Classes
    AutoTrainer
  22. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  23. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  24. def getParamInfo(p: Param[_]): ParamInfo[_]
    Definition Classes
    BaseWrappable
  25. def getReindexLabel: Boolean

  26. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  27. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  28. val inputCols: StringArrayParam

    The names of the inputColumns

    The names of the inputColumns

    Definition Classes
    HasInputCols
  29. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  30. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  31. val labelCol: Param[String]

    The name of the label column

    The name of the label column

    Definition Classes
    HasLabelCol
  32. 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.

  33. def logClass(featureName: String): Unit
    Definition Classes
    SynapseMLLogging
  34. def logFit[T](f: ⇒ T, columns: Int): T
    Definition Classes
    SynapseMLLogging
  35. def logTransform[T](f: ⇒ T, columns: Int): T
    Definition Classes
    SynapseMLLogging
  36. def logVerb[T](verb: String, f: ⇒ T, columns: Option[Int] = None): T
    Definition Classes
    SynapseMLLogging
  37. def makePyFile(conf: CodegenConfig): Unit
    Definition Classes
    PythonWrappable
  38. def makeRFile(conf: CodegenConfig): Unit
    Definition Classes
    RWrappable
  39. val model: EstimatorParam

    Model to run.

    Model to run. See doc on derived classes.

    Definition Classes
    AutoTrainer
  40. def modelDoc: String

    Doc for model to run.

    Doc for model to run.

    Definition Classes
    TrainClassifierAutoTrainer
  41. val numFeatures: IntParam

    Number of features to hash to

    Number of features to hash to

    Definition Classes
    AutoTrainer
  42. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  43. def pyAdditionalMethods: String
    Definition Classes
    PythonWrappable
  44. def pyInitFunc(): String
    Definition Classes
    PythonWrappable
  45. 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.

  46. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  47. final def set[T](param: Param[T], value: T): TrainClassifier.this.type
    Definition Classes
    Params
  48. def setFeaturesCol(value: String): TrainClassifier.this.type

    Definition Classes
    HasFeaturesCol
  49. def setInputCols(value: Array[String]): TrainClassifier.this.type

    Definition Classes
    HasInputCols
  50. def setLabelCol(value: String): TrainClassifier.this.type

    Definition Classes
    HasLabelCol
  51. def setLabels(value: Array[String]): TrainClassifier.this.type

  52. def setModel(value: Estimator[_ <: Model[_]]): TrainClassifier.this.type

    Definition Classes
    AutoTrainer
  53. def setNumFeatures(value: Int): TrainClassifier.this.type

    Definition Classes
    AutoTrainer
  54. def setReindexLabel(value: Boolean): TrainClassifier.this.type

  55. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  56. def transformSchema(schema: StructType): StructType
    Definition Classes
    TrainClassifier → PipelineStage
    Annotations
    @DeveloperApi()
  57. val uid: String
    Definition Classes
    TrainClassifierSynapseMLLogging → Identifiable
  58. def write: MLWriter
    Definition Classes
    ComplexParamsWritable → MLWritable