public class KMeans extends Estimator<KMeansModel>
Modifier and Type | Method and Description |
---|---|
KMeans |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
KMeansModel |
fit(DataFrame dataset)
Fits a model to the input data.
|
java.lang.String |
getInitMode() |
int |
getInitSteps() |
int |
getK() |
Param<java.lang.String> |
initMode()
Param for the initialization algorithm.
|
IntParam |
initSteps()
Param for the number of steps for the k-means|| initialization mode.
|
IntParam |
k()
Set the number of clusters to create (k).
|
static KMeans |
load(java.lang.String path) |
KMeans |
setFeaturesCol(java.lang.String value) |
KMeans |
setInitMode(java.lang.String value) |
KMeans |
setInitSteps(int value) |
KMeans |
setK(int value) |
KMeans |
setMaxIter(int value) |
KMeans |
setPredictionCol(java.lang.String value) |
KMeans |
setSeed(long value) |
KMeans |
setTol(double value) |
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
StructType |
validateAndTransformSchema(StructType schema)
Validates and transforms the input schema.
|
transformSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static KMeans load(java.lang.String path)
public java.lang.String uid()
Identifiable
uid
in interface Identifiable
public KMeans copy(ParamMap extra)
Params
copy
in interface Params
copy
in class Estimator<KMeansModel>
extra
- (undocumented)defaultCopy()
public KMeans setFeaturesCol(java.lang.String value)
public KMeans setPredictionCol(java.lang.String value)
public KMeans setK(int value)
public KMeans setInitMode(java.lang.String value)
public KMeans setInitSteps(int value)
public KMeans setMaxIter(int value)
public KMeans setTol(double value)
public KMeans setSeed(long value)
public KMeansModel fit(DataFrame dataset)
Estimator
fit
in class Estimator<KMeansModel>
dataset
- (undocumented)public StructType transformSchema(StructType schema)
PipelineStage
Derives the output schema from the input schema.
transformSchema
in class PipelineStage
schema
- (undocumented)public IntParam k()
public int getK()
public Param<java.lang.String> initMode()
public java.lang.String getInitMode()
public IntParam initSteps()
public int getInitSteps()
public StructType validateAndTransformSchema(StructType schema)
schema
- input schema