public class RegressionDataSet extends DataSet<RegressionDataSet>
Modifier and Type | Field and Description |
---|---|
protected List<DataPointPair<Double>> |
dataPoints
The list of all data points, paired with their true regression output
|
categories, columnVecCache, numericalVariableNames, numNumerVals
Constructor and Description |
---|
RegressionDataSet(int numerical,
CategoricalData[] categories)
Creates a new empty data set for regression
|
RegressionDataSet(List<DataPoint> data,
int predicting)
Creates a new data set for the given list of data points.
|
RegressionDataSet(List<DataPointPair<Double>> list)
Creates a new regression data set by copying all the data points
in the given list.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataPoint(DataPoint dp,
double val) |
void |
addDataPoint(Vec numerical,
double val)
Creates a new data point with no categorical variables to be added to the
data set.
|
void |
addDataPoint(Vec numerical,
int[] categories,
double val)
Creates a new data point to be added to the data set.
|
void |
addDataPointPair(DataPointPair<Double> pair) |
static RegressionDataSet |
comineAllBut(List<RegressionDataSet> list,
int exception) |
List<DataPointPair<Double>> |
getAsDPPList()
Returns a new list containing copies of the data points in this data set,
paired with their regression target values.
|
DataPoint |
getDataPoint(int i)
Returns the i'th data point in this set.
|
DataPointPair<Double> |
getDataPointPair(int i)
Returns the i'th data point in the data set paired with its target regressor value.
|
List<DataPointPair<Double>> |
getDPPList()
Returns a new list containing the data points in this data set, paired with
their regression target values.
|
int |
getSampleSize()
Returns the number of data points in this data set
|
protected RegressionDataSet |
getSubset(List<Integer> indicies)
Creates a new dataset that is a subset of this dataset.
|
double |
getTargetValue(int i)
Returns the target regression value for the i'th data point in the data set.
|
Vec |
getTargetValues()
Returns a vector containing the target regression values for each
data point.
|
RegressionDataSet |
getTwiceShallowClone()
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.
|
void |
setDataPoint(int i,
DataPoint dp)
Replaces an already existing data point with the one given.
|
void |
setTargetValue(int i,
double val)
Sets the target regression value associated with a given data point
|
RegressionDataSet |
shallowClone()
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.
|
static RegressionDataSet |
usingDPPList(List<DataPointPair<Double>> list)
Creates a new data set that uses the given list as its backing list.
|
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
protected List<DataPointPair<Double>> dataPoints
public RegressionDataSet(int numerical, CategoricalData[] categories)
numerical
- the number of numerical attributes that will be used, excluding the regression valuecategories
- an array of length equal to the number of categorical attributes, each object describing the attribute in questionpublic RegressionDataSet(List<DataPoint> data, int predicting)
data
- the list of data point to create a data set frompredicting
- which of the numerical attributes is the
regression target. Categorical attributes are ignored in
the count of attributes for this value.public RegressionDataSet(List<DataPointPair<Double>> list)
list
- source of data points to copypublic static RegressionDataSet comineAllBut(List<RegressionDataSet> list, int exception)
public void addDataPoint(Vec numerical, double val)
numerical
- the numerical values for the data pointIllegalArgumentException
- if the given values are inconsistent with the data this class stores.public void addDataPoint(Vec numerical, int[] categories, double val)
numerical
- the numerical values for the data pointcategories
- the categorical values for the data pointval
- the target value to predictIllegalArgumentException
- if the given values are inconsistent with the data this class stores.public void addDataPoint(DataPoint dp, double val)
public void addDataPointPair(DataPointPair<Double> pair)
public DataPoint getDataPoint(int i)
DataSet
getDataPoint
in class DataSet<RegressionDataSet>
i
- the i'th data point in this setpublic DataPointPair<Double> getDataPointPair(int i)
i
- the index of the data point to obtainpublic List<DataPointPair<Double>> getAsDPPList()
public List<DataPointPair<Double>> getDPPList()
getAsDPPList()
method.public void setDataPoint(int i, DataPoint dp)
DataSet
setDataPoint
in class DataSet<RegressionDataSet>
i
- the i'th dataPoint to set.dp
- the data point to set at the specified indexpublic void setTargetValue(int i, double val)
i
- the index in the data setval
- the new target valueArithmeticException
- if val is infinite or NaNprotected RegressionDataSet getSubset(List<Integer> indicies)
DataSet
getSubset
in class DataSet<RegressionDataSet>
indicies
- the indices of data points to insert into the new
dataset, and will be placed in the order listed.public int getSampleSize()
DataSet
getSampleSize
in class DataSet<RegressionDataSet>
public Vec getTargetValues()
public double getTargetValue(int i)
i
- the data point to get the regression value ofpublic static RegressionDataSet usingDPPList(List<DataPointPair<Double>> list)
list
- the list of datapoint to back a new data set withpublic RegressionDataSet shallowClone()
DataSet
shallowClone
in class DataSet<RegressionDataSet>
public RegressionDataSet getTwiceShallowClone()
DataSet
getTwiceShallowClone
in class DataSet<RegressionDataSet>
Copyright © 2017. All rights reserved.