Package org.tribuo.clustering.evaluation
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 ClusterID
s.
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.tribuo.clustering.evaluation.ClusteringMetric.Context
createContext
(Model<ClusterID> model, List<Prediction<ClusterID>> predictions) Create the context needed for evaluation.protected ClusteringEvaluation
createEvaluation
(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, evaluate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tribuo.evaluation.Evaluator
createOnlineEvaluator, evaluate
-
Constructor Details
-
ClusteringEvaluator
public ClusteringEvaluator()
-
-
Method Details
-
createMetrics
Description copied from class:AbstractEvaluator
Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo
.- Specified by:
createMetrics
in 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:AbstractEvaluator
Create the context needed for evaluation. The context might store global properties or cache computation.- Specified by:
createContext
in 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:AbstractEvaluator
Create an evaluation for the given results- Specified by:
createEvaluation
in 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
-