public class BisectingKMeansModel extends Model<BisectingKMeansModel> implements BisectingKMeansParams, MLWritable, HasTrainingSummary<BisectingKMeansSummary>
param: parentModel a model trained by BisectingKMeans
.
Modifier and Type | Method and Description |
---|---|
Vector[] |
clusterCenters() |
double |
computeCost(Dataset<?> dataset)
Deprecated.
This method is deprecated and will be removed in future versions. Use
ClusteringEvaluator instead. You can also get the cost on the training dataset in
the summary.
|
BisectingKMeansModel |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Param<String> |
distanceMeasure()
Param for The distance measure.
|
Param<String> |
featuresCol()
Param for features column name.
|
IntParam |
k()
The desired number of leaf clusters.
|
static BisectingKMeansModel |
load(String path) |
IntParam |
maxIter()
Param for maximum number of iterations (>= 0).
|
DoubleParam |
minDivisibleClusterSize()
The minimum number of points (if greater than or equal to 1.0) or the minimum proportion
of points (if less than 1.0) of a divisible cluster (default: 1.0).
|
int |
numFeatures() |
int |
predict(Vector features) |
Param<String> |
predictionCol()
Param for prediction column name.
|
static MLReader<BisectingKMeansModel> |
read() |
LongParam |
seed()
Param for random seed.
|
BisectingKMeansModel |
setFeaturesCol(String value) |
BisectingKMeansModel |
setPredictionCol(String value) |
BisectingKMeansSummary |
summary()
Gets summary of model on training set.
|
String |
toString() |
Dataset<Row> |
transform(Dataset<?> dataset)
Transforms the input dataset.
|
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
String |
uid()
An immutable unique ID for the object and its derivatives.
|
MLWriter |
write()
Returns an
MLWriter instance for this ML instance. |
transform, transform, transform
params
getK, getMinDivisibleClusterSize, validateAndTransformSchema
getMaxIter
getFeaturesCol
getPredictionCol
getDistanceMeasure
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
save
hasSummary, setSummary
initializeForcefully, initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static MLReader<BisectingKMeansModel> read()
public static BisectingKMeansModel load(String path)
public final IntParam k()
BisectingKMeansParams
k
in interface BisectingKMeansParams
public final DoubleParam minDivisibleClusterSize()
BisectingKMeansParams
minDivisibleClusterSize
in interface BisectingKMeansParams
public final Param<String> distanceMeasure()
HasDistanceMeasure
distanceMeasure
in interface HasDistanceMeasure
public final Param<String> predictionCol()
HasPredictionCol
predictionCol
in interface HasPredictionCol
public final LongParam seed()
HasSeed
public final Param<String> featuresCol()
HasFeaturesCol
featuresCol
in interface HasFeaturesCol
public final IntParam maxIter()
HasMaxIter
maxIter
in interface HasMaxIter
public String uid()
Identifiable
uid
in interface Identifiable
public int numFeatures()
public BisectingKMeansModel copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Model<BisectingKMeansModel>
extra
- (undocumented)public BisectingKMeansModel setFeaturesCol(String value)
public BisectingKMeansModel setPredictionCol(String value)
public Dataset<Row> transform(Dataset<?> dataset)
Transformer
transform
in class Transformer
dataset
- (undocumented)public StructType transformSchema(StructType schema)
PipelineStage
Check transform validity and derive the output schema from the input schema.
We check validity for interactions between parameters during transformSchema
and
raise an exception if any parameter value is invalid. Parameter value checks which
do not depend on other parameters are handled by Param.validate()
.
Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.
transformSchema
in class PipelineStage
schema
- (undocumented)public int predict(Vector features)
public Vector[] clusterCenters()
public double computeCost(Dataset<?> dataset)
dataset
- (undocumented)public MLWriter write()
MLWritable
MLWriter
instance for this ML instance.write
in interface MLWritable
public String toString()
toString
in interface Identifiable
toString
in class Object
public BisectingKMeansSummary summary()
hasSummary
is false.summary
in interface HasTrainingSummary<BisectingKMeansSummary>