public class Clustering
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
LOGGER |
Constructor and Description |
---|
Clustering() |
Clustering(SolutionSet resultFront,
ClusteringAlgorithm algorithm) |
Modifier and Type | Method and Description |
---|---|
SolutionSet |
dbscan()
DBSCAN Execution Method
- Observations:
The only measure that changes the solution is as follows:
getDBSCAN().setOptions(new String[]{"-A", "weka.core.ManhattanDistance"});
|
double |
euclidianDistance(double[] doubles1,
double[] doubles2) |
double |
euclidianDistance(Solution solution) |
ClusteringAlgorithm |
getAlgorithm() |
java.util.List<Solution> |
getAllSolutions() |
ArffExecution |
getArffExecution() |
java.util.List<Solution> |
getBestPerformingCluster() |
weka.clusterers.AbstractClusterer |
getClusterer() |
weka.clusterers.ClusterEvaluation |
getClusterEvaluation()
Cluster Evaluation Object for analysis of br.otimizes.oplatool.core.jmetal4.results
|
weka.clusterers.DBSCAN |
getDBSCAN()
Cast the Clusterer to DBSCAN Object
|
weka.core.DistanceFunction |
getDistanceFunction() |
java.lang.Double |
getEpsilon() |
java.util.List<Solution> |
getFilteredSolutions() |
int |
getGeneratedClusters() |
java.util.List<java.lang.Integer> |
getIdsFilteredSolutions() |
double |
getIndexToFilter()
Get Index to Filter
Set by default: 1 -> K-Means, 2 -> DBSCAN and OPTICS
|
weka.clusterers.SimpleKMeans |
getKMeans()
Cast the Clusterer to SimpleKMeans Object
|
double[] |
getMax() |
java.lang.Integer |
getMaxIterations() |
double[] |
getMin() |
double |
getMinClusterByObjective(int objectiveIndex)
If SimpleKMeans, returns the min centroid value by objective index, else, in case of DBSCAN that dont have
Centroid values, is verified the min value in the solutions
On DBSCAN, the clusterId -1 indicates noise
|
java.lang.Integer |
getMinPoints() |
int |
getNumClusters()
https://stats.stackexchange.com/questions/55215/way-to-determine-best-number-of-clusters-weka
https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set
|
int |
getNumObjectives() |
weka.clusterers.OPTICS |
getOPTICS()
Cast the Clusterer to OPTICS Object
|
SolutionSet |
getResultFront() |
SilhouetteIndex |
getSilhouetteIndex() |
java.util.List<Solution> |
getSolutionsByClusterId(double clusterId) |
java.util.List<Solution> |
getSolutionsByClusterWithMinObjective(int objectiveIndex) |
SolutionSet |
kMeans()
K-Means Execution Method
|
java.lang.Double |
np(java.lang.Integer num) |
SolutionSet |
optics()
Method not completed, because in the current version of Weka, the OPTICS does not present br.otimizes.oplatool.core.jmetal4.results
|
SolutionSet |
run()
Execution Method
|
void |
setAlgorithm(ClusteringAlgorithm algorithm) |
void |
setAllSolutions(java.util.List<Solution> allSolutions) |
void |
setArffExecution(ArffExecution arffExecution) |
void |
setClusterer(weka.clusterers.AbstractClusterer clusterer) |
void |
setDistanceFunction(weka.core.DistanceFunction distanceFunction) |
void |
setEpsilon(java.lang.Double epsilon) |
void |
setFilteredSolutions(java.util.List<Solution> filteredSolutions) |
void |
setIdsFilteredSolutions(java.util.List<java.lang.Integer> idsFilteredSolutions) |
void |
setIndexToFilter(double indexToFilter) |
void |
setMax(double[] max) |
void |
setMaxIterations(java.lang.Integer maxIterations) |
void |
setMin(double[] min) |
void |
setMinPoints(java.lang.Integer minPoints) |
void |
setNumClusters(java.lang.Integer numClusters) |
void |
setNumObjectives(int numObjectives) |
void |
setResultFront(SolutionSet resultFront) |
public Clustering()
public Clustering(SolutionSet resultFront, ClusteringAlgorithm algorithm)
public java.lang.Double np(java.lang.Integer num)
public SolutionSet run() throws java.lang.Exception
java.lang.Exception
- Default Exceptionpublic SolutionSet kMeans() throws java.lang.Exception
java.lang.Exception
- Default Exceptionpublic SolutionSet dbscan() throws java.lang.Exception
java.lang.Exception
public SolutionSet optics() throws java.lang.Exception
java.lang.Exception
- Default Exceptionpublic double euclidianDistance(double[] doubles1, double[] doubles2)
public double euclidianDistance(Solution solution)
public weka.clusterers.ClusterEvaluation getClusterEvaluation() throws java.lang.Exception
java.lang.Exception
- Default Exceptionpublic SilhouetteIndex getSilhouetteIndex() throws java.lang.Exception
java.lang.Exception
public weka.clusterers.SimpleKMeans getKMeans()
public weka.clusterers.DBSCAN getDBSCAN()
public weka.clusterers.OPTICS getOPTICS()
public SolutionSet getResultFront()
public void setResultFront(SolutionSet resultFront)
public ClusteringAlgorithm getAlgorithm()
public void setAlgorithm(ClusteringAlgorithm algorithm)
public weka.clusterers.AbstractClusterer getClusterer()
public void setClusterer(weka.clusterers.AbstractClusterer clusterer)
public ArffExecution getArffExecution()
public void setArffExecution(ArffExecution arffExecution)
public int getNumClusters()
public int getGeneratedClusters() throws java.lang.Exception
java.lang.Exception
public void setNumClusters(java.lang.Integer numClusters)
public java.lang.Integer getMinPoints()
public void setMinPoints(java.lang.Integer minPoints)
public java.lang.Double getEpsilon()
public void setEpsilon(java.lang.Double epsilon)
public java.util.List<Solution> getFilteredSolutions()
public java.util.List<Solution> getBestPerformingCluster()
public void setFilteredSolutions(java.util.List<Solution> filteredSolutions)
public double getIndexToFilter()
public void setIndexToFilter(double indexToFilter)
public java.util.List<java.lang.Integer> getIdsFilteredSolutions()
public void setIdsFilteredSolutions(java.util.List<java.lang.Integer> idsFilteredSolutions)
public weka.core.DistanceFunction getDistanceFunction()
public void setDistanceFunction(weka.core.DistanceFunction distanceFunction)
public java.util.List<Solution> getAllSolutions()
public void setAllSolutions(java.util.List<Solution> allSolutions)
public java.util.List<Solution> getSolutionsByClusterWithMinObjective(int objectiveIndex)
public java.util.List<Solution> getSolutionsByClusterId(double clusterId)
public double getMinClusterByObjective(int objectiveIndex)
objectiveIndex
- Objective array indexpublic int getNumObjectives()
public void setNumObjectives(int numObjectives)
public double[] getMin()
public void setMin(double[] min)
public double[] getMax()
public void setMax(double[] max)
public java.lang.Integer getMaxIterations()
public void setMaxIterations(java.lang.Integer maxIterations)