@PublicAPI public class Ward extends Common
An example for running Ward:
ConnectionHandler ch; String selectString; ... Ward ward=new Ward(); ward.setInput(ch, selectString); ward.setOutput(System.out); ward.setDimensions(0); ward.setFpSize(512); ward.setClusterCount(10); ward.setCentralShown(false); ward.setSingletonNegative(false); ward.setStatNeeded(true); ward.setOnlyStat(false); ward.setStatStream(System.out); ward.setKelleyStats("kelley_results.txt"); ward.setMode(Ward.RNN_AND_CLUSTERING); // execution mode ward.setIdGeneration(true); ward.run();
Modifier and Type | Field and Description |
---|---|
static int |
ONLY_CLUSTERING |
static int |
ONLY_RNN |
static int |
RNN_AND_CLUSTERING |
Constructor and Description |
---|
Ward() |
Modifier and Type | Method and Description |
---|---|
boolean |
getCentralShown()
Indicates whether central objects are displayed.
|
int |
getClusterCount()
Gets the number of clusters.
|
int |
getMode()
Gets the clustering mode.
|
boolean |
isSingletonNegative()
Indicates whether singeltons get negative cluster id-s.
|
static void |
main(java.lang.String[] args)
The command line version entry point.
|
void |
run()
Starts processing.
|
void |
setCentralShown(boolean b)
Specifies if cluster centers should be diplayed.
|
void |
setClusterCount(int count)
Sets the number of clusters.
|
void |
setInput(ConnectionHandler conh,
java.lang.String querySQL)
Sets input as an SQL query.
|
void |
setInput(java.io.File file)
Sets input as a File.
|
void |
setInput(java.io.InputStream is)
Sets input as an InputStream
|
void |
setInput(java.lang.String fileName)
Sets input as a file, specified by its path.
|
void |
setKelleyStats(java.io.File file)
Directs Kelley statistics to a File.
|
void |
setKelleyStats(java.io.PrintStream ps)
Directs Kelley statistics to a PrintStream.
|
void |
setKelleyStats(java.lang.String fileName)
Directs Kelley statistics to a File specified with a name.
|
void |
setMode(int mode)
Sets the clustering mode.
|
void |
setSingletonNegative(boolean b)
Specifies whether singletons get negative cluste id-s.
|
getDimensions, getElapsedTime, getFpSize, getIdGeneration, getStartTime, getStatStream, getWeights, isOnlyStat, isStatNeeded, setDimensions, setFpSize, setIdGeneration, setOnlyStat, setOutput, setOutput, setOutput, setOutput, setStatNeeded, setStatStream, setWeights
public static final int RNN_AND_CLUSTERING
public static final int ONLY_RNN
public static final int ONLY_CLUSTERING
public void setInput(ConnectionHandler conh, java.lang.String querySQL) throws java.sql.SQLException
conh
- ConnectionHandler object opened to the databasequerySQL
- an SQL SELECT statement used as data sourcejava.sql.SQLException
public void setInput(java.io.File file) throws java.io.FileNotFoundException
file
- the File to be used for inputjava.io.FileNotFoundException
public void setInput(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- the path of File to be used for inputjava.io.FileNotFoundException
public void setInput(java.io.InputStream is)
is
- the InputStream to be used for inputpublic void setCentralShown(boolean b)
b
- if set to true
, central objects are calculated
and shown in output.public boolean getCentralShown()
true
if central objects are calculated and shown
in output.public void setKelleyStats(java.io.PrintStream ps)
ps
- the PrintStream where Kelley statistics directed to, or
null
,if no Kelley statistics needed.public void setKelleyStats(java.io.File file) throws java.io.FileNotFoundException
file
- the File where Kelley statistics directed to, or
null
,if no Kelley statistics needed.java.io.FileNotFoundException
public void setKelleyStats(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- the path of the file where Kelley statistics directed
to, or null
,if no Kelley statistics needed.java.io.FileNotFoundException
public void setSingletonNegative(boolean b)
b
- If set to true
, singeltons get negative cluster
id-s.public boolean isSingletonNegative()
true
, if singeltons get negative cluster
id-s.public void setClusterCount(int count)
count
- the number of clusterspublic int getClusterCount()
public void setMode(int mode)
mode
- clustering mode constantpublic int getMode()
public void run() throws chemaxon.clustering.ClusteringException, java.io.IOException, java.sql.SQLException, chemaxon.clustering.InvalidLicenseKeyException
chemaxon.clustering.ClusteringException
java.io.IOException
java.sql.SQLException
chemaxon.clustering.InvalidLicenseKeyException
public static void main(java.lang.String[] args)