Class/Object

com.microsoft.ml.spark

TrainClassifier

Related Docs: object TrainClassifier | package spark

Permalink

class TrainClassifier extends Estimator[TrainedClassifierModel] with HasLabelCol with ComplexParamsWritable with HasFeaturesCol

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

Linear Supertypes
HasFeaturesCol, ComplexParamsWritable, MLWritable, HasLabelCol, Wrappable, Estimator[TrainedClassifierModel], PipelineStage, org.apache.spark.internal.Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. TrainClassifier
  2. HasFeaturesCol
  3. ComplexParamsWritable
  4. MLWritable
  5. HasLabelCol
  6. Wrappable
  7. Estimator
  8. PipelineStage
  9. Logging
  10. Params
  11. Serializable
  12. Serializable
  13. Identifiable
  14. AnyRef
  15. 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. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink

    The name of the features column

    The name of the features column

    Definition Classes
    HasFeaturesCol
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. 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
  21. def fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[TrainedClassifierModel]

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

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

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

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

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

    Permalink
    Definition Classes
    Params
  27. def getFeaturesCol: String

    Permalink

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

    Permalink
  29. def getLabelCol: String

    Permalink

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

    Permalink

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

    Permalink

  32. def getNumFeatures: Int

    Permalink

  33. final def getOrDefault[T](param: Param[T]): T

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

    Permalink
    Definition Classes
    Params
  35. def getReindexLabel: Boolean

    Permalink

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

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

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

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

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

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

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

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

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

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

    Permalink

    The name of the label column

    The name of the label column

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

  47. def log: Logger

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink

    Classifier to run.

    Classifier to run. 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.

  60. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  63. val numFeatures: IntParam

    Permalink

    Number of features to hash to

  64. lazy val params: Array[Param[_]]

    Permalink
    Definition Classes
    Params
  65. 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.

  66. def save(path: String): Unit

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

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

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

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

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

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

  76. def setNumFeatures(value: Int): TrainClassifier.this.type

    Permalink

  77. def setReindexLabel(value: Boolean): TrainClassifier.this.type

    Permalink

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  86. 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 org.apache.spark.internal.Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Parameters

A list of parameter keys this algorithm can take. Users can set and get the parameter values through setters and getters

Parameter setters

Parameter getters

Members