jsat.clustering
Class FLAME
- java.lang.Object
-
- jsat.clustering.ClustererBase
-
- jsat.clustering.FLAME
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, Parameterized
public class FLAME extends ClustererBase implements Parameterized
Provides an implementation of the FLAME clustering algorithm. The original FLAME paper does not describe all necessary details for an implementation, so results may differ between implementations.
FLAME is highly sensitive to the number of neighbors chosen. Increasing the neighbors tends to reduce the number of clusters formed.
See: Fu, L.,&Medico, E. (2007). FLAME, a novel fuzzy clustering method for the analysis of DNA microarray data. BMC Bioinformatics, 8(1), 3. Retrieved from here- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FLAME(DistanceMetric dm, int k, int maxIterations)Creates a new FLAME clustering objectFLAME(FLAME toCopy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FLAMEclone()int[]cluster(DataSet dataSet, boolean parallel, int[] designations)Performs clustering on the given data set.DistanceMetricgetDistanceMetric()Returns the distance metric to use for the nearest neighbor searchdoublegetEps()Returns the minimum difference in scores to consider FLAME convergedintgetK()Returns the number of neighbors usedintgetMaxIterations()Returns the maximum number of iterations to performdoublegetStndDevs()Returns the number of standard deviations away from the mean density an outlier must bevoidsetDistanceMetric(DistanceMetric dm)Sets the distance metric to use for the nearest neighbor searchvoidsetEps(double eps)Sets the convergence goal for the minimum difference in score between rounds.voidsetK(int k)Sets the number of neighbors that will be considered in determining Cluster Supporting Points and assignment contributions.voidsetMaxIterations(int maxIterations)Sets the maximum number of iterations to perform.voidsetStndDevs(double stndDevs)Sets the number of standard deviations away from the mean density a candidate outlier must be to be confirmed as an outlier.voidsetVectorCollectionFactory(VectorCollection<VecPaired<Vec,java.lang.Integer>> vc)Sets the vector collection used to accelerate the nearest neighbor search.-
Methods inherited from class jsat.clustering.ClustererBase
createClusterListFromAssignmentArray, getDatapointsFromCluster
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, cluster, supportsWeightedData
-
-
-
-
Constructor Detail
-
FLAME
public FLAME(DistanceMetric dm, int k, int maxIterations)
Creates a new FLAME clustering object- Parameters:
dm- the distance metric to usek- the number of neighbors to considermaxIterations- the maximum number of iterations to perform
-
FLAME
public FLAME(FLAME toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Sets the maximum number of iterations to perform. FLAME can require far more iterations to converge than necessary to get the same hard clustering result.- Parameters:
maxIterations- the maximum number of iterations to perform
-
getMaxIterations
public int getMaxIterations()
Returns the maximum number of iterations to perform- Returns:
- the maximum number of iterations to perform
-
setK
public void setK(int k)
Sets the number of neighbors that will be considered in determining Cluster Supporting Points and assignment contributions.- Parameters:
k- the number of neighbors to consider
-
getK
public int getK()
Returns the number of neighbors used- Returns:
- the number of neighbors used
-
setEps
public void setEps(double eps)
Sets the convergence goal for the minimum difference in score between rounds. Negative values are allowed to force all iterations to occur- Parameters:
eps- the minimum difference in scores for convergence
-
getEps
public double getEps()
Returns the minimum difference in scores to consider FLAME converged- Returns:
- the minimum difference in scores to consider FLAMe converged
-
setStndDevs
public void setStndDevs(double stndDevs)
Sets the number of standard deviations away from the mean density a candidate outlier must be to be confirmed as an outlier.- Parameters:
stndDevs- the number of standard deviations away from the mean density an outlier must be
-
getStndDevs
public double getStndDevs()
Returns the number of standard deviations away from the mean density an outlier must be- Returns:
- the number of standard deviations away from the mean density an outlier must be
-
setDistanceMetric
public void setDistanceMetric(DistanceMetric dm)
Sets the distance metric to use for the nearest neighbor search- Parameters:
dm- the distance metric to use
-
getDistanceMetric
public DistanceMetric getDistanceMetric()
Returns the distance metric to use for the nearest neighbor search- Returns:
- the distance metric to use
-
setVectorCollectionFactory
public void setVectorCollectionFactory(VectorCollection<VecPaired<Vec,java.lang.Integer>> vc)
Sets the vector collection used to accelerate the nearest neighbor search. The nearest neighbor only needs to be done once for each point, so the collection should be faster than the naive method when considering both construction and search time.- Parameters:
vc- the vector collection to use
-
cluster
public int[] cluster(DataSet dataSet, boolean parallel, int[] designations)
Description copied from interface:ClustererPerforms clustering on the given data set. Parameters may be estimated by the method, or other heuristics performed.- Specified by:
clusterin interfaceClusterer- Parameters:
dataSet- the data set to perform clustering onparallel-trueif multiple threads should be used to perform clustering.falseif it should be done in a single threaded manner.designations- the array which will contain the designated values. The array will be altered and returned by the function. If null is given, a new array will be created and returned.- Returns:
- the int[]
-
clone
public FLAME clone()
- Specified by:
clonein interfaceClusterer- Specified by:
clonein classClustererBase
-
-
DataMelt 3.0 © DataMelt by jWork.ORG