|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simbrain.gauge.core.Dataset
public class 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()
Default constructor for adding datasets. |
|
Dataset(ArrayList data)
Creates an instance of dataset. |
|
Dataset(int ndims)
Creates and instance of Dataset. |
|
| 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 datapointNumber,
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. |
ArrayList |
getDataset()
|
int |
getDimensions()
|
double |
getDistance(double[] point1,
double[] point2)
Returns tyhe euclidean distance between two points. |
double |
getDistance(int index1,
int index2)
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. |
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()
|
ArrayList |
getPersistentData()
|
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. |
void |
initCastor()
Initializes Dataset from persitent data. |
void |
initPersistentData()
Initializes persistant data. |
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(File file)
Read in stored dataset file. |
void |
resultsToMaple()
Print out low dimensional points so maple can plot them Just does low dimension = 2. |
void |
saveData(File theFile)
Save the current datast to a stored file. |
void |
setComponent(int datapointNumber,
int dimension,
double newValue)
Set a specific coordinate of a specific datapoint. |
void |
setDataset(ArrayList list)
|
void |
setPersistentData(ArrayList theData)
Sets data that is to be persitent. |
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(ArrayList data)
data - ArrayList of data to be used for Datasetpublic Dataset(int ndims)
ndims - dimension of dataset| 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)
upperBound - highest value to be usedpublic void calculateDistances()
public double getMinimumDistance()
public double getMaximumDistance()
public void readData(File file)
file - Name of file to read inpublic void saveData(File theFile)
theFile - the file where data should be savedpublic void perturbOverlappingPoints(double factor)
factor - Distance to perturbpublic void resultsToMaple()
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 point
public double getComponent(int datapointNumber,
int dimension)
datapointNumber - index of the point to getdimension - dimension of the desired component
public void setComponent(int datapointNumber,
int dimension,
double newValue)
datapointNumber - index of the point to getdimension - dimension of the desired componentnewValue - the new value of the n'th component of the specified datapoint
public 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 added
public 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 index1,
int index2)
index1 - index of point 1index2 - index of point 2
public double getDistance(double[] point1,
double[] point2)
point1 - First point of distancepoint2 - Second point of distance
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 - Number of variant dimension
public ArrayList getDataset()
public void setDataset(ArrayList list)
list - the datasetpublic void printDataset()
public String[][] getDoubleStrings()
public double[][] getDoubles()
public void initPersistentData()
public ArrayList getPersistentData()
public void setPersistentData(ArrayList theData)
theData - Data set to be persitentpublic void initCastor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||