jsat
Class SimpleDataSet
- java.lang.Object
-
- jsat.DataSet<SimpleDataSet>
-
- jsat.SimpleDataSet
-
public class SimpleDataSet extends DataSet<SimpleDataSet>
SimpleData Set is a basic implementation of a data set. Has no assumptions about the task that is going to be performed.
-
-
Constructor Summary
Constructors Constructor and Description SimpleDataSet(CategoricalData[] categories, int numNumericalValues)SimpleDataSet(java.util.List<DataPoint> dataPoints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(DataPoint dp)Adds a new datapoint to this set.ClassificationDataSetasClassificationDataSet(int index)Converts this dataset into one meant for classification problems.RegressionDataSetasRegressionDataSet(int index)Converts this dataset into one meant for regression problems.java.util.List<DataPoint>getBackingList()DataPointgetDataPoint(int i)Returns the i'th data point in this set.intgetSampleSize()Returns the number of data points in this data setSimpleDataSetgetTwiceShallowClone()Returns a new version of this data set that is of the same type, and contains a different listing pointing to shallow data point copies.voidsetDataPoint(int i, DataPoint dp)Replaces an already existing data point with the one given.SimpleDataSetshallowClone()Returns a new version of this data set that is of the same type, and contains a different list pointing to the same data points.-
Methods inherited from class jsat.DataSet
applyTransform, applyTransform, applyTransform, applyTransform, countMissingValues, cvSet, cvSet, getCategories, getCategoryName, getColumnMeanVariance, getDataMatrix, getDataMatrixView, getDataPointIterator, getDataPoints, getDataVectors, getDataWeights, getMissingDropped, getNumCategoricalVars, getNumericColumn, getNumericColumns, getNumericColumns, getNumericName, getNumFeatures, getNumNumericalVars, getOnlineColumnStats, getOnlineDenseStats, getSparsityStats, randomSplit, randomSplit, replaceNumericFeatures, setNumericName
-
-
-
-
Constructor Detail
-
SimpleDataSet
public SimpleDataSet(java.util.List<DataPoint> dataPoints)
-
SimpleDataSet
public SimpleDataSet(CategoricalData[] categories, int numNumericalValues)
-
-
Method Detail
-
getDataPoint
public DataPoint getDataPoint(int i)
Description copied from class:DataSetReturns the i'th data point in this set. The order will never chance so long as no data points are added or removed from the set.- Specified by:
getDataPointin classDataSet<SimpleDataSet>- Parameters:
i- the i'th data point in this set- Returns:
- the i'th data point in this set
-
setDataPoint
public void setDataPoint(int i, DataPoint dp)Description copied from class:DataSetReplaces an already existing data point with the one given. Any values associated with the data point, but not apart of it, will remain intact.- Specified by:
setDataPointin classDataSet<SimpleDataSet>- Parameters:
i- the i'th dataPoint to set.dp- the data point to set at the specified index
-
add
public void add(DataPoint dp)
Adds a new datapoint to this set.- Parameters:
dp- the datapoint to add
-
getSampleSize
public int getSampleSize()
Description copied from class:DataSetReturns the number of data points in this data set- Specified by:
getSampleSizein classDataSet<SimpleDataSet>- Returns:
- the number of data points in this data set
-
asClassificationDataSet
public ClassificationDataSet asClassificationDataSet(int index)
Converts this dataset into one meant for classification problems. The given categorical feature index is removed from the data and made the target variable for the classification problem.- Parameters:
index- the classification variable index, should be in the range [0,DataSet.getNumCategoricalVars())- Returns:
- a new dataset where one categorical variable is removed and made the target of a classification dataset
-
asRegressionDataSet
public RegressionDataSet asRegressionDataSet(int index)
Converts this dataset into one meant for regression problems. The given numeric feature index is removed from the data and made the target variable for the regression problem.- Parameters:
index- the regression variable index, should be in the range [0,DataSet.getNumNumericalVars())- Returns:
- a new dataset where one numeric variable is removed and made the target of a regression dataset
-
getBackingList
public java.util.List<DataPoint> getBackingList()
- Returns:
- direct access to the list that backs this data set.
-
shallowClone
public SimpleDataSet shallowClone()
Description copied from class:DataSetReturns a new version of this data set that is of the same type, and contains a different list pointing to the same data points.- Specified by:
shallowClonein classDataSet<SimpleDataSet>- Returns:
- a shallow copy of this data set
-
getTwiceShallowClone
public SimpleDataSet getTwiceShallowClone()
Description copied from class:DataSetReturns a new version of this data set that is of the same type, and contains a different listing pointing to shallow data point copies. Because the data point object contains the weight itself, the weight is not shared - while the vector and array information is. This allows altering the weights of the data points while preserving the original weights.
Altering the list or weights of the returned data set will not be reflected in the original. Altering the feature values will.- Overrides:
getTwiceShallowClonein classDataSet<SimpleDataSet>- Returns:
- a shallow copy of shallow data point copies for this data set.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG