public class Cluster
extends java.lang.Object
Constructor and Description |
---|
Cluster(int attributes,
int qValue,
int kValue)
Buider.Builts a empty cluster, setting its parameters
|
Modifier and Type | Method and Description |
---|---|
void |
add(int ins)
Add an element into the cluster
|
Cluster |
clone()
Clone method.
|
int |
drop(int index)
Drop an element from the cluster
|
void |
dropByContent(int number)
Drop an element from the cluster
|
int |
get(int index)
Get an element from the cluster
|
int[] |
getAll()
Get all elements from the cluster
|
double[] |
getCentroid()
Get the centroid of the cluster
|
int[] |
getInnerBorder()
Get the inner border of the cluster
|
int[] |
getOuterBorder()
Get the outer border of the cluster
|
boolean |
getProperties()
See if values calculated for the cluster are valid
|
int |
getSize()
See size.
|
double |
getStdDev()
Get stdDev of the cluster
|
double |
getVariance()
Get variance of the cluster
|
boolean |
isEmpty()
See if the cluster is empty
|
void |
set(int ins,
int index)
Set an element into the cluster
|
void |
setAll(int[] ins)
Set all elements into the cluster
|
void |
setCentroid(double[] values)
Set the centroid of the cluster
|
void |
setInnerBorder(int[] value)
Set the inner border of the cluster
|
void |
setOuterBorder(int[] value)
Set the outer border of the cluster
|
void |
setProperties()
Validate the values calculated for the cluster
|
void |
setVariance(double value)
Get variance and stdDev of the cluster
|
public Cluster(int attributes, int qValue, int kValue)
attributes
- Dimensionality of instancesqValue
- Value of qkValue
- Value of kpublic Cluster clone()
clone
in class java.lang.Object
public int getSize()
public boolean isEmpty()
public int get(int index)
index
- Index of the elementpublic void set(int ins, int index)
ins
- Index of the instance in the train dataindex
- Index of the elementpublic int[] getAll()
public void setAll(int[] ins)
ins
- Indexes of the instances in the train datapublic void add(int ins)
ins
- Index of the instance in the train datapublic int drop(int index)
index
- Index of the instance in the clusterpublic void dropByContent(int number)
number
- Index of the instance in train datapublic double[] getCentroid()
public void setCentroid(double[] values)
values
- Values of the centroidpublic void setInnerBorder(int[] value)
value
- Values of the inner borderpublic int[] getInnerBorder()
public void setOuterBorder(int[] value)
value
- Values of the outer borderpublic int[] getOuterBorder()
public double getVariance()
public double getStdDev()
public void setVariance(double value)
value
- Value of the variancepublic void setProperties()
public boolean getProperties()