public class fuzzygCenter
extends java.lang.Object
This class represents a group of centers (centroids) of a set of fuzzy clusters
Constructor and Description |
---|
fuzzygCenter()
Creates a new instance of gCenter
|
fuzzygCenter(int k,
int ndatos,
int nvariables,
double fuzzifier)
Creates a new instance of gCenter with provided number of centers, number of instances of the
data set and number of attributes
|
Modifier and Type | Method and Description |
---|---|
void |
copyCenter(Instance i,
int c)
this function initializes a center with the values of a given instance.
|
double |
distance(Instance i,
int k)
Computes the distance between a instances (without previous normalization) and
one clusters (i.e. its centroid).
|
int |
getClusterOf(Instance i)
Returns the cluster to which the given instance belongs to
|
double |
getMembershipOf(int orderOf_i,
int k)
Returns the membership degree of the instance for a given cluster
|
int |
nearestCenter(Instance inst)
Computes the nearest cluster to the given instance
(for nominal values only)
|
void |
recalculateCenters(InstanceSet IS)
Recalculates all the centroids using a given InstanceSet, to reduce the
sum of the distances for each object from the centroid of the cluster to which the object belongs
|
void |
setMembershipOf(Instance i,
int orderOf_i)
Computes the memebership degree of a given instance to all the clusters
|
java.lang.String |
valueAt(int cluster,
int position)
Get the value of an attribute of the indicated centroid
|
public fuzzygCenter()
public fuzzygCenter(int k, int ndatos, int nvariables, double fuzzifier)
Creates a new instance of gCenter with provided number of centers, number of instances of the data set and number of attributes
k
- Fixed number of centroidsndatos
- number of instances in the data set related to this objectnvariables
- number of attributesfuzzifier
- The parameter m (> 1) used to fuzzify the clusterspublic double distance(Instance i, int k)
Computes the distance between a instances (without previous normalization) and one clusters (i.e. its centroid).
i
- The reference instancek
- The cluster numberpublic void copyCenter(Instance i, int c)
this function initializes a center with the values of a given instance.
i
- the initialization instancec
- the index of the cluster to be initializedpublic void recalculateCenters(InstanceSet IS)
Recalculates all the centroids using a given InstanceSet, to reduce the sum of the distances for each object from the centroid of the cluster to which the object belongs
IS
- The reference InstanceSetpublic void setMembershipOf(Instance i, int orderOf_i)
Computes the memebership degree of a given instance to all the clusters
i
- The instance to update the membershipsorderOf_i
- The index of the instancepublic double getMembershipOf(int orderOf_i, int k)
Returns the membership degree of the instance for a given cluster
orderOf_i
- the index of the instancek
- the index of the considered clusterpublic int nearestCenter(Instance inst)
Computes the nearest cluster to the given instance (for nominal values only)
inst
- The instance we are interested to comparepublic int getClusterOf(Instance i)
Returns the cluster to which the given instance belongs to
i
- given instancepublic java.lang.String valueAt(int cluster, int position)
Get the value of an attribute of the indicated centroid
cluster
- The index of the cluster (centroid)position
- The attribute (dimension) to be obtained