Documentation of 'jsat.SimpleDataSet' Java class
SimpleDataSet
jsat

Class 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 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: DataSet
        Returns 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:
        getDataPoint in class DataSet<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: DataSet
        Replaces 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:
        setDataPoint in class DataSet<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: DataSet
        Returns the number of data points in this data set
        Specified by:
        getSampleSize in class DataSet<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: DataSet
        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.
        Specified by:
        shallowClone in class DataSet<SimpleDataSet>
        Returns:
        a shallow copy of this data set
      • getTwiceShallowClone

        public SimpleDataSet getTwiceShallowClone()
        Description copied from class: DataSet
        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. 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:
        getTwiceShallowClone in class DataSet<SimpleDataSet>
        Returns:
        a shallow copy of shallow data point copies for this data set.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.