public class ClusterID extends Object implements Output<ClusterID>
The id is an int, referring to a cluster stored in the model. Optionally contains a score representing the strength of association with that cluster, if available.
The id is UNASSIGNED
if the output is not assigned to a
cluster (e.g., before the Model
has been trained).
Modifier and Type | Field and Description |
---|---|
static int |
UNASSIGNED |
Constructor and Description |
---|
ClusterID(int id)
Creates a ClusterID with the sentinel score of
Double.NaN . |
ClusterID(int id,
double score)
Creates a ClusterID with the specified id number and score.
|
Modifier and Type | Method and Description |
---|---|
ClusterID |
copy()
Deep copy of the output up to it's immutable state.
|
boolean |
equals(Object o) |
boolean |
fullEquals(ClusterID o)
Compares other to this output.
|
int |
getID()
Gets the cluster id number.
|
double |
getScore()
Get a real valued score for this ClusterID.
|
String |
getSerializableForm(boolean includeConfidence)
Returns "id" or "id,score=idScore".
|
int |
hashCode() |
String |
toString() |
public static final int UNASSIGNED
public ClusterID(int id)
Double.NaN
.id
- The cluster id number.public ClusterID(int id, double score)
id
- The cluster id number.score
- The score.public double getScore()
If the score is not set then it returns Double.NaN.
public int getID()
public boolean fullEquals(ClusterID o)
Output
fullEquals
in interface Output<ClusterID>
o
- Another output instance.public ClusterID copy()
Output
public String getSerializableForm(boolean includeConfidence)
getSerializableForm
in interface Output<ClusterID>
includeConfidence
- Include whatever confidence score the clusterID contains, if known.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.