public final class ClusteringFactory extends Object implements OutputFactory<ClusterID>
Parses the ClusterID by calling toString on the input then parsing it as an int.
Modifier and Type | Class and Description |
---|---|
static class |
ClusteringFactory.ClusteringFactoryProvenance
Provenance for
ClusteringFactory . |
Modifier and Type | Field and Description |
---|---|
static ClusterID |
UNASSIGNED_CLUSTER_ID |
Constructor and Description |
---|
ClusteringFactory()
ClusteringFactory is stateless and immutable, but we need to be able to construct them via the config system.
|
Modifier and Type | Method and Description |
---|---|
ImmutableOutputInfo<ClusterID> |
constructInfoForExternalModel(Map<ClusterID,Integer> mapping)
Unlike the other info types, clustering directly uses the integer IDs as the stored value,
so this mapping discards the cluster IDs and just uses the supplied integers.
|
boolean |
equals(Object obj) |
MutableOutputInfo<ClusterID> |
generateInfo()
Generates the appropriate
MutableOutputInfo so the
output values can be tracked by a Dataset or other
aggregate. |
<V> ClusterID |
generateOutput(V label)
Generates a ClusterID by calling toString on the input, then calling Integer.parseInt.
|
Evaluator<ClusterID,ClusteringEvaluation> |
getEvaluator()
Gets an
Evaluator suitable for measuring performance of predictions for the Output subclass. |
OutputFactoryProvenance |
getProvenance() |
ClusterID |
getUnknownOutput()
Returns the singleton unknown output of type T which can be used for prediction time examples.
|
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
generateOutputs, validateMapping
public static final ClusterID UNASSIGNED_CLUSTER_ID
public ClusteringFactory()
public <V> ClusterID generateOutput(V label)
generateOutput
in interface OutputFactory<ClusterID>
V
- The type of the input.label
- An input value.public ClusterID getUnknownOutput()
OutputFactory
getUnknownOutput
in interface OutputFactory<ClusterID>
public MutableOutputInfo<ClusterID> generateInfo()
OutputFactory
MutableOutputInfo
so the
output values can be tracked by a Dataset
or other
aggregate.generateInfo
in interface OutputFactory<ClusterID>
MutableOutputInfo
initialised to zero.public ImmutableOutputInfo<ClusterID> constructInfoForExternalModel(Map<ClusterID,Integer> mapping)
constructInfoForExternalModel
in interface OutputFactory<ClusterID>
mapping
- The mapping to use.ImmutableOutputInfo
for the clustering.public Evaluator<ClusterID,ClusteringEvaluation> getEvaluator()
OutputFactory
Evaluator
suitable for measuring performance of predictions for the Output subclass.
Evaluator
instances are thread safe and immutable, and commonly this is a singleton
stored in the OutputFactory
implementation.
getEvaluator
in interface OutputFactory<ClusterID>
public OutputFactoryProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.