org.apache.spark.ml.tuning
Class CrossValidatorModel

Object
  extended by org.apache.spark.ml.PipelineStage
      extended by org.apache.spark.ml.Transformer
          extended by org.apache.spark.ml.Model<CrossValidatorModel>
              extended by org.apache.spark.ml.tuning.CrossValidatorModel
All Implemented Interfaces:
java.io.Serializable, Logging, Params

public class CrossValidatorModel
extends Model<CrossValidatorModel>

:: Experimental :: Model from k-fold cross validation.

See Also:
Serialized Form

Method Summary
 Object bestModel()
           
 CrossValidatorModel copy(ParamMap extra)
          Creates a copy of this instance with the same UID and some extra params.
 Param<Estimator<?>> estimator()
          param for the estimator to be cross-validated
 Param<ParamMap[]> estimatorParamMaps()
          param for estimator param maps
 Param<Evaluator> evaluator()
          param for the evaluator used to select hyper-parameters that maximize the cross-validated metric
 Estimator<?> getEstimator()
           
 ParamMap[] getEstimatorParamMaps()
           
 Evaluator getEvaluator()
           
 int getNumFolds()
           
 IntParam numFolds()
          Param for number of folds for cross validation.
 DataFrame transform(DataFrame dataset)
          Transforms the input dataset.
 StructType transformSchema(StructType schema)
          :: DeveloperApi ::
 String uid()
           
 void validateParams()
          Validates parameter values stored internally.
 
Methods inherited from class org.apache.spark.ml.Model
hasParent, parent, setParent
 
Methods inherited from class org.apache.spark.ml.Transformer
transform, transform, transform
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, setDefault, shouldOwn
 
Methods inherited from interface org.apache.spark.Logging
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
 

Method Detail

uid

public String uid()

bestModel

public Object bestModel()

validateParams

public void validateParams()
Description copied from interface: Params
Validates parameter values stored internally. Raise an exception if any parameter value is invalid.

This only needs to check for interactions between parameters. Parameter value checks which do not depend on other parameters are handled by Param.validate(). This method does not handle input/output column parameters; those are checked during schema validation.

Specified by:
validateParams in interface Params

transform

public DataFrame transform(DataFrame dataset)
Description copied from class: Transformer
Transforms the input dataset.

Specified by:
transform in class Transformer
Parameters:
dataset - (undocumented)
Returns:
(undocumented)

transformSchema

public StructType transformSchema(StructType schema)
Description copied from class: PipelineStage
:: DeveloperApi ::

Derives the output schema from the input schema.

Specified by:
transformSchema in class PipelineStage
Parameters:
schema - (undocumented)
Returns:
(undocumented)

copy

public CrossValidatorModel copy(ParamMap extra)
Description copied from interface: Params
Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly.

Specified by:
copy in interface Params
Specified by:
copy in class Model<CrossValidatorModel>
Parameters:
extra - (undocumented)
Returns:
(undocumented)
See Also:
defaultCopy()

estimator

public Param<Estimator<?>> estimator()
param for the estimator to be cross-validated

Returns:
(undocumented)

getEstimator

public Estimator<?> getEstimator()

estimatorParamMaps

public Param<ParamMap[]> estimatorParamMaps()
param for estimator param maps

Returns:
(undocumented)

getEstimatorParamMaps

public ParamMap[] getEstimatorParamMaps()

evaluator

public Param<Evaluator> evaluator()
param for the evaluator used to select hyper-parameters that maximize the cross-validated metric

Returns:
(undocumented)

getEvaluator

public Evaluator getEvaluator()

numFolds

public IntParam numFolds()
Param for number of folds for cross validation. Must be >= 2. Default: 3

Returns:
(undocumented)

getNumFolds

public int getNumFolds()