|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.hisee.core.Dataset
Dataset represents a set of n-dimensional points. Both the low and high dimensional
data of the current Projector
are instances of this class. Dataset provides methods for
working with such sets (e.g. open dataset up, adding points, checking their integrity,
finding nearest neighbors of a point, calculating
their interpoint distances, etc.). It is assumed that all points in a dataset have
the same dimensionality.
Constructor Summary | |
Dataset()
|
|
Dataset(java.util.ArrayList data)
|
|
Dataset(int ndims,
int npoints)
|
Method Summary | |
void |
addPoint(double[] row)
Add datapoint without checking whether it is unique or not |
boolean |
addPoint(double[] row,
double tolerance)
Add a new datapoint to the dataset |
void |
calculateDistances()
Calculate inter-point distancese |
boolean |
checkConsistentDimensions()
Check that all the vectors in the dataset have the same dimension |
void |
clear()
Clear all data, high and low dimensional |
double |
getClosestDistance(double[] point)
Returns the point closest to a given point |
int |
getClosestIndex(double[] point)
Returns the index of the closest point |
double |
getComponent(int datapoint_number,
int dimension)
Get a specific coordinate of a specific datapoint. |
double |
getCovariance(int i,
int j)
Returns the covariance of the ith component of the dataset with respect to the jth component |
Jama.Matrix |
getCovarianceMatrix()
Returns a covariance matrix for the dataset |
java.util.ArrayList |
getDataset()
|
int |
getDimensions()
|
double |
getDistance(double[] point1,
double[] point2)
Returns tyhe euclidean distance between two points |
double |
getDistance(int index_1,
int index_2)
Get the distance between two points |
double[][] |
getDistances()
Returns a matrix of interpoint distances, between the points in the dataset. |
double[][] |
getDoubles()
Returns a matrix of double, one row for each datapoint, representing the dataset. |
java.lang.String[][] |
getDoubleStrings()
Returns a matrix of strings, one row for each datapoint, representing the dataset. |
int |
getKthNearestNeighbor(int k,
double[] point)
Returns the k'th nearest neighbor. |
int |
getKthVariantDimension(int k)
Returns the k'th most variant dimesion. |
double |
getMaximumDistance()
Get the maximimum interpoint distance between points in the dataset. |
double |
getMean(int d)
Returns the mean of the dataset on a given dimension |
double |
getMinimumDistance()
Get the minimum interpoint distance between points in the dataset. |
int |
getNumPoints()
|
double[] |
getPoint(int i)
Get a specificed point in the dataset |
double |
getSumDistances()
|
void |
init()
Initialize the dataset, setting the main variables to the property values. |
void |
init(int dims,
int numpoints)
Re-initialize a dataset to a specific number of dimensions and number of points. |
boolean |
isUniquePoint(double[] point,
double tolerance)
Check that a given point is "new", that is, that it is not already in the dataset. |
void |
perturbOverlappingPoints(double factor)
Find repeated points and perturb them slightly so they don't overlap |
void |
printDataset()
Print out all points in the dataset Useful for debugging |
void |
randomize(int upperBound)
Randomize dataset to a value between 0 and upperBound |
void |
readData(java.io.File file)
Read in stored dataset file |
void |
results_to_maple()
Print out low dimensional points so maple can plot them Just does low dimension = 2 |
void |
saveData(java.io.File theFile)
Save the current datast to a stored file |
void |
setComponent(int datapoint_number,
int dimension,
double new_value)
Set a specific coordinate of a specific datapoint. |
void |
setDataset(java.util.ArrayList list)
|
void |
setPoint(int i,
double[] point)
Set a specified point in the dataset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Dataset()
public Dataset(java.util.ArrayList data)
public Dataset(int ndims, int npoints)
Method Detail |
public void init()
public void init(int dims, int numpoints)
dims
- Dimensions of the datasetnumpoints
- Number of datapoints in the datasetpublic void clear()
public boolean checkConsistentDimensions()
public void randomize(int upperBound)
public void calculateDistances()
public double getMinimumDistance()
public double getMaximumDistance()
public void readData(java.io.File file)
public void saveData(java.io.File theFile)
theFile
- the file where data should be savedpublic void perturbOverlappingPoints(double factor)
public void results_to_maple()
public double[] getPoint(int i)
i
- index of the point to get
public void setPoint(int i, double[] point)
i
- the point to setpoint
- the new n-dimensional pointpublic double getComponent(int datapoint_number, int dimension)
datapoint_number
- index of the point to getdimension
- dimension of the desired component
public void setComponent(int datapoint_number, int dimension, double new_value)
datapoint_number
- index of the point to getdimension
- dimension of the desired componentnew_value
- the new value of the n'th component of the specified datapointpublic boolean addPoint(double[] row, double tolerance)
row
- A point in the high dimensional spacetolerance
- forwarded to isUniquePoint; if -1 then add point regardless of whether it is unique or not
public void addPoint(double[] row)
row
- point to be addedpublic boolean isUniquePoint(double[] point, double tolerance)
point
- the point to checktolerance
- distance within which a point is considered old, and outside of which it is considered new
public double getClosestDistance(double[] point)
point
- the point to check
public int getClosestIndex(double[] point)
point
- the point to check
public int getKthNearestNeighbor(int k, double[] point)
k
- which nearest neighbor (first, second, etc.) to findpoint
- the point whose neighbors are to be found
public double getDistance(int index_1, int index_2)
index_1
- index of point 1index_2
- index of point 2
public double getDistance(double[] point1, double[] point2)
point1
- point2
-
public int getDimensions()
public double[][] getDistances()
public int getNumPoints()
public double getSumDistances()
public double getMean(int d)
d
- index of the dimension whose mean to get
public double getCovariance(int i, int j)
i
- first dimensionj
- seconnd dimesion
public Jama.Matrix getCovarianceMatrix()
public int getKthVariantDimension(int k)
k
-
public java.util.ArrayList getDataset()
public void setDataset(java.util.ArrayList list)
list
- the datasetpublic void printDataset()
public java.lang.String[][] getDoubleStrings()
public double[][] getDoubles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |