public class ClusteringEvaluator extends Evaluator implements HasPredictionCol, HasFeaturesCol, DefaultParamsWritable
The Silhouette is a measure for the validation of the consistency within clusters. It ranges between 1 and -1, where a value close to 1 means that the points in a cluster are close to the other points in the same cluster and far from the points of the other clusters.
| Constructor and Description | 
|---|
ClusteringEvaluator()  | 
ClusteringEvaluator(String uid)  | 
| Modifier and Type | Method and Description | 
|---|---|
ClusteringEvaluator | 
copy(ParamMap pMap)
Creates a copy of this instance with the same UID and some extra params. 
 | 
Param<String> | 
distanceMeasure()
param for distance measure to be used in evaluation
 (supports  
"squaredEuclidean" (default), "cosine") | 
double | 
evaluate(Dataset<?> dataset)
Evaluates model output and returns a scalar metric. 
 | 
Param<String> | 
featuresCol()
Param for features column name. 
 | 
String | 
getDistanceMeasure()  | 
String | 
getMetricName()  | 
boolean | 
isLargerBetter()
Indicates whether the metric returned by  
evaluate should be maximized (true, default)
 or minimized (false). | 
static ClusteringEvaluator | 
load(String path)  | 
Param<String> | 
metricName()
param for metric name in evaluation
 (supports  
"silhouette" (default)) | 
Param<String> | 
predictionCol()
Param for prediction column name. 
 | 
static MLReader<T> | 
read()  | 
ClusteringEvaluator | 
setDistanceMeasure(String value)  | 
ClusteringEvaluator | 
setFeaturesCol(String value)  | 
ClusteringEvaluator | 
setMetricName(String value)  | 
ClusteringEvaluator | 
setPredictionCol(String value)  | 
String | 
toString()  | 
String | 
uid()
An immutable unique ID for the object and its derivatives. 
 | 
getPredictionColgetFeaturesColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwnwritesavepublic ClusteringEvaluator(String uid)
public ClusteringEvaluator()
public static ClusteringEvaluator load(String path)
public static MLReader<T> read()
public final Param<String> featuresCol()
HasFeaturesColfeaturesCol in interface HasFeaturesColpublic final Param<String> predictionCol()
HasPredictionColpredictionCol in interface HasPredictionColpublic String uid()
Identifiableuid in interface Identifiablepublic ClusteringEvaluator copy(ParamMap pMap)
ParamsdefaultCopy().public boolean isLargerBetter()
Evaluatorevaluate should be maximized (true, default)
 or minimized (false).
 A given evaluator may support multiple metrics which may be maximized or minimized.isLargerBetter in class Evaluatorpublic ClusteringEvaluator setPredictionCol(String value)
public ClusteringEvaluator setFeaturesCol(String value)
public Param<String> metricName()
"silhouette" (default))public String getMetricName()
public ClusteringEvaluator setMetricName(String value)
public Param<String> distanceMeasure()
"squaredEuclidean" (default), "cosine")public String getDistanceMeasure()
public ClusteringEvaluator setDistanceMeasure(String value)
public double evaluate(Dataset<?> dataset)
EvaluatorisLargerBetter specifies whether larger values are better.
 public String toString()
toString in interface IdentifiabletoString in class Object