Class SequentialDatabase
java.lang.Object
weka.clusterers.forOPTICSAndDBScan.Databases.SequentialDatabase
- All Implemented Interfaces:
Serializable
,Database
,RevisionHandler
SequentialDatabase.java
Authors: Rainer Holzmann, Zhanna Melnikova-Albrecht, Matthias Schubert
Date: Aug 20, 2004
Time: 1:23:38 PM
$ Revision 1.4 $
- Version:
- $Revision: 1.4 $
- Author:
- Matthias Schubert (schubert@dbs.ifi.lmu.de), Zhanna Melnikova-Albrecht (melnikov@cip.ifi.lmu.de), Rainer Holzmann (holzmann@cip.ifi.lmu.de)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSequentialDatabase
(Instances instances) Constructs a new sequential database and holds the original instances -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(DataObject dataObject_Query) Tests if the database contains the dataObject_QuerycoreDistance
(int minPoints, double epsilon, DataObject dataObject) Calculates the coreDistance for the specified DataObject.Returns an iterator over all the dataObjects in the databaseepsilonRangeQuery
(double epsilon, DataObject queryDataObject) Performs an epsilon range query for this dataObjectdouble[]
Returns the array of maximum-values for each attributedouble[]
Returns the array of minimum-values for each attributegetDataObject
(String key) Select a dataObject from the databaseReturns the original instances delivered from WEKAReturns the revision string.void
insert
(DataObject dataObject) Inserts a new dataObject into the databasek_nextNeighbourQuery
(int k, double epsilon, DataObject dataObject) Emits the k next-neighbours and performs an epsilon-range-query at the parallel.Returns an iterator over all the keysvoid
Sets the minimum and maximum values for each attribute in different arrays by walking through every DataObject of the databaseint
size()
Returns the size of the database (the number of dataObjects in the database)
-
Constructor Details
-
SequentialDatabase
Constructs a new sequential database and holds the original instances- Parameters:
instances
-
-
-
Method Details
-
getDataObject
Select a dataObject from the database- Specified by:
getDataObject
in interfaceDatabase
- Parameters:
key
- The key that is associated with the dataObject- Returns:
- dataObject
-
setMinMaxValues
public void setMinMaxValues()Sets the minimum and maximum values for each attribute in different arrays by walking through every DataObject of the database- Specified by:
setMinMaxValues
in interfaceDatabase
-
getAttributeMinValues
public double[] getAttributeMinValues()Returns the array of minimum-values for each attribute- Specified by:
getAttributeMinValues
in interfaceDatabase
- Returns:
- attributeMinValues
-
getAttributeMaxValues
public double[] getAttributeMaxValues()Returns the array of maximum-values for each attribute- Specified by:
getAttributeMaxValues
in interfaceDatabase
- Returns:
- attributeMaxValues
-
epsilonRangeQuery
Performs an epsilon range query for this dataObject- Specified by:
epsilonRangeQuery
in interfaceDatabase
- Parameters:
epsilon
- Specifies the range for the queryqueryDataObject
- The dataObject that is used as query-object for epsilon range query- Returns:
- List with all the DataObjects that are within the specified range
-
k_nextNeighbourQuery
Emits the k next-neighbours and performs an epsilon-range-query at the parallel. The returned list contains two elements: At index=0 --> list with all k next-neighbours; At index=1 --> list with all dataObjects within epsilon;- Specified by:
k_nextNeighbourQuery
in interfaceDatabase
- Parameters:
k
- number of next neighboursepsilon
- Specifies the range for the querydataObject
- the start object- Returns:
- list with the k-next neighbours (PriorityQueueElements) and a list with candidates from the epsilon-range-query (EpsilonRange_ListElements)
-
coreDistance
Calculates the coreDistance for the specified DataObject. The returned list contains three elements: At index=0 --> list with all k next-neighbours; At index=1 --> list with all dataObjects within epsilon; At index=2 --> coreDistance as Double-value- Specified by:
coreDistance
in interfaceDatabase
- Parameters:
minPoints
- minPoints-many neighbours within epsilon must be found to have a non-undefined coreDistanceepsilon
- Specifies the range for the querydataObject
- Calculate coreDistance for this dataObject- Returns:
- list with the k-next neighbours (PriorityQueueElements) and a list with candidates from the epsilon-range-query (EpsilonRange_ListElements) and the double-value for the calculated coreDistance
-
size
public int size()Returns the size of the database (the number of dataObjects in the database) -
keyIterator
Returns an iterator over all the keys- Specified by:
keyIterator
in interfaceDatabase
- Returns:
- iterator
-
dataObjectIterator
Returns an iterator over all the dataObjects in the database- Specified by:
dataObjectIterator
in interfaceDatabase
- Returns:
- iterator
-
contains
Tests if the database contains the dataObject_Query -
insert
Inserts a new dataObject into the database -
getInstances
Returns the original instances delivered from WEKA- Specified by:
getInstances
in interfaceDatabase
- Returns:
- instances
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-