Class/Object

com.microsoft.ml.spark.train

TrainClassifier

Related Docs: object TrainClassifier | package train

Permalink

class TrainClassifier extends Estimator[TrainedClassifierModel] with AutoTrainer[TrainedClassifierModel]

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.

Annotations
@InternalWrapper()
Linear Supertypes
AutoTrainer[TrainedClassifierModel], HasFeaturesCol, ComplexParamsWritable, MLWritable, HasLabelCol, Wrappable, Estimator[TrainedClassifierModel], PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TrainClassifier
  2. AutoTrainer
  3. HasFeaturesCol
  4. ComplexParamsWritable
  5. MLWritable
  6. HasLabelCol
  7. Wrappable
  8. Estimator
  9. PipelineStage
  10. Logging
  11. Params
  12. Serializable
  13. Serializable
  14. Identifiable
  15. AnyRef
  16. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TrainClassifier()

    Permalink
  2. new TrainClassifier(uid: String)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def additionalPythonMethods(): String

    Permalink
    Definition Classes
    Wrappable
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. final def clear(param: Param[_]): TrainClassifier.this.type

    Permalink
    Definition Classes
    Params
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def convertLabel(dataset: Dataset[_], labelColumn: String, labelValues: Option[Array[_]]): (DataFrame, Option[Array[_]])

    Permalink
  10. def copy(extra: ParamMap): Estimator[TrainedClassifierModel]

    Permalink
    Definition Classes
    TrainClassifier → Estimator → PipelineStage → Params
  11. def copyValues[T <: Params](to: T, extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  12. final def defaultCopy[T <: Params](extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def explainParam(param: Param[_]): String

    Permalink
    Definition Classes
    Params
  16. def explainParams(): String

    Permalink
    Definition Classes
    Params
  17. final def extractParamMap(): ParamMap

    Permalink
    Definition Classes
    Params
  18. final def extractParamMap(extra: ParamMap): ParamMap

    Permalink
    Definition Classes
    Params
  19. val featuresCol: Param[String]

    Permalink

    The name of the features column

    The name of the features column

    Definition Classes
    HasFeaturesCol
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fit(dataset: Dataset[_]): TrainedClassifierModel

    Permalink

    Fits the classification model.

    Fits the classification model.

    dataset

    The input dataset to train.

    returns

    The trained classification model.

    Definition Classes
    TrainClassifier → Estimator
  22. def fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[TrainedClassifierModel]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  23. def fit(dataset: Dataset[_], paramMap: ParamMap): TrainedClassifierModel

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  24. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): TrainedClassifierModel

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  25. final def get[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def getDefault[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  28. def getFeaturesCol: String

    Permalink

    Definition Classes
    HasFeaturesCol
  29. def getFeaturizeParams: (Boolean, Boolean, Int)

    Permalink
  30. def getLabelCol: String

    Permalink

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

    Permalink

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

    Permalink

    Definition Classes
    AutoTrainer
  33. def getNumFeatures: Int

    Permalink

    Definition Classes
    AutoTrainer
  34. final def getOrDefault[T](param: Param[T]): T

    Permalink
    Definition Classes
    Params
  35. def getParam(paramName: String): Param[Any]

    Permalink
    Definition Classes
    Params
  36. def getReindexLabel: Boolean

    Permalink

  37. final def hasDefault[T](param: Param[T]): Boolean

    Permalink
    Definition Classes
    Params
  38. def hasParam(paramName: String): Boolean

    Permalink
    Definition Classes
    Params
  39. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  40. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  41. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  42. final def isDefined(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  43. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  44. final def isSet(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  45. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  46. val labelCol: Param[String]

    Permalink

    The name of the label column

    The name of the label column

    Definition Classes
    HasLabelCol
  47. val labels: StringArrayParam

    Permalink

    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.

  48. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  49. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  50. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  51. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  52. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  53. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  54. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  55. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  56. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  57. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  58. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  59. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  60. val model: EstimatorParam

    Permalink

    Model to run.

    Model to run. See doc on derived classes.

    Definition Classes
    AutoTrainer
  61. def modelDoc: String

    Permalink

    Doc for model to run.

    Doc for model to run.

    Definition Classes
    TrainClassifierAutoTrainer
  62. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  63. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  64. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  65. val numFeatures: IntParam

    Permalink

    Number of features to hash to

    Number of features to hash to

    Definition Classes
    AutoTrainer
  66. lazy val params: Array[Param[_]]

    Permalink
    Definition Classes
    Params
  67. val reindexLabel: BooleanParam

    Permalink

    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.

  68. def save(path: String): Unit

    Permalink
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  69. final def set(paramPair: ParamPair[_]): TrainClassifier.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  70. final def set(param: String, value: Any): TrainClassifier.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  71. final def set[T](param: Param[T], value: T): TrainClassifier.this.type

    Permalink
    Definition Classes
    Params
  72. final def setDefault(paramPairs: ParamPair[_]*): TrainClassifier.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  73. final def setDefault[T](param: Param[T], value: T): TrainClassifier.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  74. def setFeaturesCol(value: String): TrainClassifier.this.type

    Permalink

    Definition Classes
    HasFeaturesCol
  75. def setLabelCol(value: String): TrainClassifier.this.type

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

  80. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  81. def toString(): String

    Permalink
    Definition Classes
    Identifiable → AnyRef → Any
  82. def transformSchema(schema: StructType): StructType

    Permalink
    Definition Classes
    TrainClassifier → PipelineStage
    Annotations
    @DeveloperApi()
  83. def transformSchema(schema: StructType, logging: Boolean): StructType

    Permalink
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  84. val uid: String

    Permalink
    Definition Classes
    TrainClassifier → Identifiable
  85. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  86. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  87. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. def write: MLWriter

    Permalink
    Definition Classes
    ComplexParamsWritable → MLWritable

Inherited from HasFeaturesCol

Inherited from ComplexParamsWritable

Inherited from MLWritable

Inherited from HasLabelCol

Inherited from Wrappable

Inherited from Estimator[TrainedClassifierModel]

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

getParam

param

setParam

Ungrouped