public class OPTICS extends AbstractClusterer implements OptionHandler, TechnicalInformationHandler
@inproceedings{Ankerst1999, author = {Mihael Ankerst and Markus M. Breunig and Hans-Peter Kriegel and Joerg Sander}, booktitle = {ACM SIGMOD International Conference on Management of Data}, pages = {49-60}, publisher = {ACM Press}, title = {OPTICS: Ordering Points To Identify the Clustering Structure}, year = {1999} }Valid options are:
-E <double> epsilon (default = 0.9)
-M <int> minPoints (default = 6)
-I <String> index (database) used for OPTICS (default = weka.clusterers.forOPTICSAndDBScan.Databases.SequentialDatabase)
-D <String> distance-type (default = weka.clusterers.forOPTICSAndDBScan.DataObjects.EuclideanDataObject)
-F write results to OPTICS_#TimeStamp#.TXT - File
-no-gui suppress the display of the GUI after building the clusterer
-db-output <file> The file to save the generated database to. If a directory is provided, the database doesn't get saved. The generated file can be viewed with the OPTICS Visualizer: java weka.clusterers.forOPTICSAndDBScan.OPTICS_GUI.OPTICS_Visualizer [file.ser] (default: .)
Constructor and Description |
---|
OPTICS() |
Modifier and Type | Method and Description |
---|---|
void |
buildClusterer(Instances instances)
Generate Clustering via OPTICS
|
int |
clusterInstance(Instance instance)
Classifies a given instance.
|
java.lang.String |
database_distanceTypeTipText()
Returns the tip text for this property
|
java.lang.String |
database_TypeTipText()
Returns the tip text for this property
|
Database |
databaseForName(java.lang.String database_Type,
Instances instances)
Returns a new Class-Instance of the specified database
|
java.lang.String |
databaseOutputTipText()
Returns the tip text for this property.
|
DataObject |
dataObjectForName(java.lang.String database_distanceType,
Instance instance,
java.lang.String key,
Database database)
Returns a new Class-Instance of the specified database
|
java.lang.String |
epsilonTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns default capabilities of the clusterer.
|
java.lang.String |
getDatabase_distanceType()
Returns the distance-type
|
java.lang.String |
getDatabase_Type()
Returns the type of the used index (database)
|
java.io.File |
getDatabaseOutput()
Returns the file to save the database to - if directory, database is not
saved.
|
double |
getEpsilon()
Returns the value of epsilon
|
int |
getMinPoints()
Returns the value of minPoints
|
java.lang.String[] |
getOptions()
Gets the current option settings for the OptionHandler.
|
FastVector |
getResultVector()
Returns the resultVector
|
java.lang.String |
getRevision()
Returns the revision string.
|
SERObject |
getSERObject()
Returns the internal database
|
boolean |
getShowGUI()
Returns the flag for showing the OPTICS visualizer GUI.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
boolean |
getWriteOPTICSresults()
Returns the flag for writing actions
|
java.lang.String |
globalInfo()
Returns a string describing this DataMining-Algorithm
|
java.util.Enumeration |
listOptions()
Returns an enumeration of all the available options.
|
static void |
main(java.lang.String[] args)
Main Method for testing OPTICS
|
java.lang.String |
minPointsTipText()
Returns the tip text for this property
|
int |
numberOfClusters()
Returns the number of clusters.
|
void |
setDatabase_distanceType(java.lang.String database_distanceType)
Sets a new distance-type
|
void |
setDatabase_Type(java.lang.String database_Type)
Sets a new database-type
|
void |
setDatabaseOutput(java.io.File value)
Sets the the file to save the generated database to.
|
void |
setEpsilon(double epsilon)
Sets a new value for epsilon
|
void |
setMinPoints(int minPoints)
Sets a new value for minPoints
|
void |
setOptions(java.lang.String[] options)
Sets the OptionHandler's options using the given list.
|
void |
setShowGUI(boolean value)
Sets the flag for displaying the GUI.
|
void |
setWriteOPTICSresults(boolean writeOPTICSresults)
Sets the flag for writing actions
|
java.lang.String |
showGUITipText()
Returns the tip text for this property.
|
java.lang.String |
toString()
Returns a description of the clusterer
|
java.lang.String |
writeOPTICSresultsTipText()
Returns the tip text for this property
|
distributionForInstance, forName, makeCopies, makeCopy
public Capabilities getCapabilities()
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClusterer
Capabilities
public void buildClusterer(Instances instances) throws java.lang.Exception
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
instances
- The instances that need to be clusteredjava.lang.Exception
- If clustering was not successfulpublic int clusterInstance(Instance instance) throws java.lang.Exception
clusterInstance
in interface Clusterer
clusterInstance
in class AbstractClusterer
instance
- The instance to be assigned to a clusterjava.lang.Exception
- If instance could not be clustered
successfullypublic int numberOfClusters() throws java.lang.Exception
numberOfClusters
in interface Clusterer
numberOfClusters
in class AbstractClusterer
java.lang.Exception
- If number of clusters could not be returned
successfullypublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-E <double> epsilon (default = 0.9)
-M <int> minPoints (default = 6)
-I <String> index (database) used for OPTICS (default = weka.clusterers.forOPTICSAndDBScan.Databases.SequentialDatabase)
-D <String> distance-type (default = weka.clusterers.forOPTICSAndDBScan.DataObjects.EuclideanDataObject)
-F write results to OPTICS_#TimeStamp#.TXT - File
-no-gui suppress the display of the GUI after building the clusterer
-db-output <file> The file to save the generated database to. If a directory is provided, the database doesn't get saved. The generated file can be viewed with the OPTICS Visualizer: java weka.clusterers.forOPTICSAndDBScan.OPTICS_GUI.OPTICS_Visualizer [file.ser] (default: .)
setOptions
in interface OptionHandler
options
- The list of options as an array of stringsjava.lang.Exception
- If an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Database databaseForName(java.lang.String database_Type, Instances instances)
database_Type
- String of the specified databaseinstances
- Instances that were delivered from WEKApublic DataObject dataObjectForName(java.lang.String database_distanceType, Instance instance, java.lang.String key, Database database)
database_distanceType
- String of the specified distance-typeinstance
- The original instance that needs to hold by this DataObjectkey
- Key for this DataObjectdatabase
- Link to the databasepublic void setMinPoints(int minPoints)
minPoints
- MinPointspublic void setEpsilon(double epsilon)
epsilon
- Epsilonpublic double getEpsilon()
public int getMinPoints()
public java.lang.String getDatabase_distanceType()
public java.lang.String getDatabase_Type()
public void setDatabase_distanceType(java.lang.String database_distanceType)
database_distanceType
- The new distance-typepublic void setDatabase_Type(java.lang.String database_Type)
database_Type
- The new database-typepublic boolean getWriteOPTICSresults()
public void setWriteOPTICSresults(boolean writeOPTICSresults)
writeOPTICSresults
- Results are written to a file if the flag is setpublic boolean getShowGUI()
public void setShowGUI(boolean value)
value
- if true, then the OPTICS visualizer GUI will be
displayed after building the clustererpublic java.io.File getDatabaseOutput()
public void setDatabaseOutput(java.io.File value)
value
- the file to save the database to or a directory if
saving is to be ignoredpublic FastVector getResultVector()
public java.lang.String epsilonTipText()
public java.lang.String minPointsTipText()
public java.lang.String database_TypeTipText()
public java.lang.String database_distanceTypeTipText()
public java.lang.String writeOPTICSresultsTipText()
public java.lang.String showGUITipText()
public java.lang.String databaseOutputTipText()
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public SERObject getSERObject()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public static void main(java.lang.String[] args)
args
- Valid parameters are: 'E' epsilon (default = 0.9); 'M' minPoints (default = 6);
'I' index-type (default = weka.clusterers.forOPTICSAndDBScan.Databases.SequentialDatabase);
'D' distance-type (default = weka.clusterers.forOPTICSAndDBScan.DataObjects.EuclideanDataObject);
'F' write results to OPTICS_#TimeStamp#.TXT - File