Class ClusteringEvaluator
java.lang.Object
org.tribuo.evaluation.AbstractEvaluator<ClusterID, org.tribuo.clustering.evaluation.ClusteringMetric.Context, ClusteringEvaluation, ClusteringMetric>
org.tribuo.clustering.evaluation.ClusteringEvaluator
- All Implemented Interfaces:
Evaluator<ClusterID, ClusteringEvaluation>
public class ClusteringEvaluator
extends AbstractEvaluator<ClusterID, org.tribuo.clustering.evaluation.ClusteringMetric.Context, ClusteringEvaluation, ClusteringMetric>
A
Evaluator for clustering using ClusterIDs.
If the dataset contains an unassigned cluster id (as generated by ClusteringFactory.getUnknownOutput())
then the evaluate methods will throw IllegalArgumentException with an appropriate message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.tribuo.clustering.evaluation.ClusteringMetric.ContextcreateContext(Model<ClusterID> model, List<Prediction<ClusterID>> predictions) Create the context needed for evaluation.protected ClusteringEvaluationcreateEvaluation(org.tribuo.clustering.evaluation.ClusteringMetric.Context context, Map<MetricID<ClusterID>, Double> results, EvaluationProvenance provenance) Create an evaluation for the given resultsprotected Set<ClusteringMetric> createMetrics(Model<ClusterID> model) Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo.Methods inherited from class org.tribuo.evaluation.AbstractEvaluator
computeResults, evaluate, evaluate, evaluateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.evaluation.Evaluator
createOnlineEvaluator, evaluate
-
Constructor Details
-
ClusteringEvaluator
public ClusteringEvaluator()
-
-
Method Details
-
createMetrics
Description copied from class:AbstractEvaluatorCreates the appropriate set of metrics for this model, by querying for it'sOutputInfo.- Specified by:
createMetricsin classAbstractEvaluator<ClusterID, org.tribuo.clustering.evaluation.ClusteringMetric.Context, ClusteringEvaluation, ClusteringMetric>- Parameters:
model- The model to inspect.- Returns:
- The set of metrics.
-
createContext
protected org.tribuo.clustering.evaluation.ClusteringMetric.Context createContext(Model<ClusterID> model, List<Prediction<ClusterID>> predictions) Description copied from class:AbstractEvaluatorCreate the context needed for evaluation. The context might store global properties or cache computation.- Specified by:
createContextin classAbstractEvaluator<ClusterID, org.tribuo.clustering.evaluation.ClusteringMetric.Context, ClusteringEvaluation, ClusteringMetric>- Parameters:
model- the model that will be evaluatedpredictions- the predictions that will be evaluated- Returns:
- the context for this model and its predictions
-
createEvaluation
protected ClusteringEvaluation createEvaluation(org.tribuo.clustering.evaluation.ClusteringMetric.Context context, Map<MetricID<ClusterID>, Double> results, EvaluationProvenance provenance) Description copied from class:AbstractEvaluatorCreate an evaluation for the given results- Specified by:
createEvaluationin classAbstractEvaluator<ClusterID, org.tribuo.clustering.evaluation.ClusteringMetric.Context, ClusteringEvaluation, ClusteringMetric>- Parameters:
context- the context that was used to compute these resultsresults- the resultsprovenance- the provenance of the results (including information about the model and dataset)- Returns:
- the evaluation
-