Documentation of 'Catalano.MachineLearning.Dataset.DatasetRegression' Java class
DatasetRegression
Catalano.MachineLearning.Dataset

Class DatasetRegression

  • All Implemented Interfaces:
    IDataset<double[][],double[]>, java.io.Serializable


    public class DatasetRegression
    extends java.lang.Object
    implements IDataset<double[][],double[]>
    Dataset for regression.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DatasetRegression(java.lang.String filepath)
      Initializes a new instance of the DatasetRegression class.
      DatasetRegression(java.lang.String name, double[][] input, double[] output)
      Initializes a new instance of the DatasetClassification class.
      DatasetRegression(java.lang.String name, double[][] input, double[] output, DecisionVariable[] attributes)
      Initializes a new instance of the DatasetClassification class.
      DatasetRegression(java.lang.String filepath, java.lang.String name)
      Initializes a new instance of the DatasetRegression class.
      DatasetRegression(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo)
      Initializes a new instance of the DatasetRegression class.
      DatasetRegression(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo, int classIndex)
      Initializes a new instance of the DatasetRegression class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name)
      Read dataset from a CSV structure.
      static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo)
      Read dataset from a CSV structure.
      static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo, int classIndex)
      Construct a dataset from an CSV file.
      DecisionVariable[] getAllDecisionVariables()
      Get the decision variables including the output.
      int getClassIndex()
      Get class index.
      DecisionVariable[] getDecisionVariables()
      Get the decision variables.
      double[][] getInput()
      Get the input data.
      java.lang.String getName()
      Get the name of the dataset.
      int getNumberOfAttributes()
      Get the number of attributes.
      int getNumberOfContinuous()
      Get the number of type continuous.
      int getNumberOfDiscrete()
      Get the number of type discrete.
      int getNumberOfInstances()
      Get the number of instances.
      double[] getOutput()
      Get the output data.
      StatisticsDataset[] getStatistics()
      Get the statistics from the dataset.
      void KeepAttributes(int[] indexes)
      Keep the selected attributes and remove the rest.
      double[][] Normalize()
      Normalize all continuous data.
      double[][] Normalize(double min, double max)
      Normalize all continuous data.
      void RemoveAttribute(int index)
      Remove an attribute.
      void RemoveAttributes(int[] indexes)
      Remove selected attributes.
      void setClassIndex(int classIndex)
      Set class index.
      void setInput(double[][] input, DecisionVariable[] variables)
      Set the input data.
      DatasetRegression Split(float percentage)
      Split the percentange of the dataset in Trainning and the rest in Validation.
      DatasetRegression Split(float percentage, java.lang.String name)
      Split the percentange of the dataset in Trainning and the rest in Validation.
      double[][] Standartize()
      Standartize all continuous data.
      void WriteAsARFF(java.lang.String filename)
      Write dataset as ARFF file.
      void WriteAsARFF(java.lang.String filename, int decimalPlaces)
      Write dataset as ARFF file.
      void WriteAsCSV(java.lang.String filename)
      Write the dataset as CSV file.
      void WriteAsCSV(java.lang.String filename, int decimalPlaces)
      Write the dataset as CSV file.
      void WriteAsCSV(java.lang.String filename, int decimalPlaces, char delimiter)
      Write the dataset as CSV file.
      void WriteAsCSV(java.lang.String filename, int decimalPlaces, char delimiter, java.lang.String newLine)
      Write the dataset as CSV file.
      void WriteAsCSV(java.lang.String filename, int decimalPlaces, char delimiter, java.lang.String newLine, boolean writeHeader)
      Write the dataset as CSV file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatasetRegression

        public DatasetRegression(java.lang.String filepath)
        Initializes a new instance of the DatasetRegression class.
        Parameters:
        filepath - File path.
      • DatasetRegression

        public DatasetRegression(java.lang.String filepath,
                                 java.lang.String name)
        Initializes a new instance of the DatasetRegression class.
        Parameters:
        filepath - File path.
        name - Name of the dataset.
      • DatasetRegression

        public DatasetRegression(java.lang.String filepath,
                                 java.lang.String name,
                                 boolean ignoreAttributeInfo)
        Initializes a new instance of the DatasetRegression class.
        Parameters:
        filepath - File path.
        name - Name of the data.
        ignoreAttributeInfo - Ignore attribute information.
      • DatasetRegression

        public DatasetRegression(java.lang.String filepath,
                                 java.lang.String name,
                                 boolean ignoreAttributeInfo,
                                 int classIndex)
        Initializes a new instance of the DatasetRegression class.
        Parameters:
        filepath - File path.
        name - Name of the dataset.
        ignoreAttributeInfo - Ignore attribute information.
        classIndex - Output index.
      • DatasetRegression

        public DatasetRegression(java.lang.String name,
                                 double[][] input,
                                 double[] output)
        Initializes a new instance of the DatasetClassification class.
        Parameters:
        name - Name of the dataset.
        input - Input data.
        output - Output data.
      • DatasetRegression

        public DatasetRegression(java.lang.String name,
                                 double[][] input,
                                 double[] output,
                                 DecisionVariable[] attributes)
        Initializes a new instance of the DatasetClassification class.
        Parameters:
        name - Name of the dataset.
        attributes - Decision variables.
        input - Input data.
        output - Output data.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of the dataset.
        Returns:
        Name.
      • getInput

        public double[][] getInput()
        Get the input data.
        Specified by:
        getInput in interface IDataset<double[][],double[]>
        Returns:
        Input data.
      • getOutput

        public double[] getOutput()
        Get the output data.
        Specified by:
        getOutput in interface IDataset<double[][],double[]>
        Returns:
        Output data.
      • getClassIndex

        public int getClassIndex()
        Get class index.
        Returns:
        Class index.
      • setClassIndex

        public void setClassIndex(int classIndex)
        Set class index.
        Parameters:
        classIndex - Class index.
      • getAllDecisionVariables

        public DecisionVariable[] getAllDecisionVariables()
        Get the decision variables including the output.
        Returns:
        Decision Variables.
      • getNumberOfInstances

        public int getNumberOfInstances()
        Get the number of instances.
        Returns:
        Number of instances.
      • getNumberOfAttributes

        public int getNumberOfAttributes()
        Get the number of attributes.
        Returns:
        Number of attributes.
      • getNumberOfContinuous

        public int getNumberOfContinuous()
        Get the number of type continuous.
        Returns:
        Number of type continuous.
      • getNumberOfDiscrete

        public int getNumberOfDiscrete()
        Get the number of type discrete.
        Returns:
        Number of type discrete.
      • FromCSV

        public static DatasetRegression FromCSV(java.lang.String filepath,
                                                java.lang.String name)
        Read dataset from a CSV structure. The last column of CSV is interpreted as output.
        Parameters:
        filepath - File path.
        name - Name of the dataset.
        Returns:
        Classification Dataset.
      • FromCSV

        public static DatasetRegression FromCSV(java.lang.String filepath,
                                                java.lang.String name,
                                                boolean ignoreAttributeInfo)
        Read dataset from a CSV structure. The last column of CSV is interpreted as output.
        Parameters:
        filepath - File path.
        name - Name of the dataset.
        Returns:
        Classification Dataset.
      • FromCSV

        public static DatasetRegression FromCSV(java.lang.String filepath,
                                                java.lang.String name,
                                                boolean ignoreAttributeInfo,
                                                int classIndex)
        Construct a dataset from an CSV file.
        Parameters:
        filepath - File.
        name - Name of the dataset.
        ignoreAttributeInfo - Ignore attribute information.
        classIndex - Index of the attribute for to be setup as output.
        Returns:
        ClassificationDataset.
      • Normalize

        public double[][] Normalize()
        Normalize all continuous data. Default: (0..1).
        Returns:
        Range of the normalization.
      • Normalize

        public double[][] Normalize(double min,
                                    double max)
        Normalize all continuous data.
        Parameters:
        min - Minimum.
        max - Maximum.
        Returns:
        Range of the normalization.
      • RemoveAttribute

        public void RemoveAttribute(int index)
        Remove an attribute.
        Parameters:
        index - Index of the attribute.
      • RemoveAttributes

        public void RemoveAttributes(int[] indexes)
        Remove selected attributes.
        Parameters:
        indexes - Indexes of the attributes.
      • KeepAttributes

        public void KeepAttributes(int[] indexes)
        Keep the selected attributes and remove the rest.
        Parameters:
        indexes - Indexes of the attributes.
      • Split

        public DatasetRegression Split(float percentage)
        Split the percentange of the dataset in Trainning and the rest in Validation.
        Parameters:
        percentage - Percentage.
        Returns:
        Validation dataset.
      • Split

        public DatasetRegression Split(float percentage,
                                       java.lang.String name)
        Split the percentange of the dataset in Trainning and the rest in Validation.
        Parameters:
        percentage - Percentage.
        name - Name of the validation dataset.
        Returns:
        Validation dataset.
      • Standartize

        public double[][] Standartize()
        Standartize all continuous data. x = (x - u) / s
        Returns:
        Range of standartization.
      • getStatistics

        public StatisticsDataset[] getStatistics()
        Description copied from interface: IDataset
        Get the statistics from the dataset.
        Specified by:
        getStatistics in interface IDataset<double[][],double[]>
        Returns:
        Statistics.
      • WriteAsCSV

        public void WriteAsCSV(java.lang.String filename)
        Write the dataset as CSV file.
        Parameters:
        filename - Filename.
      • WriteAsCSV

        public void WriteAsCSV(java.lang.String filename,
                               int decimalPlaces)
        Write the dataset as CSV file.
        Parameters:
        filename - Filename.
        decimalPlaces - Decimal places for continous data.
      • WriteAsCSV

        public void WriteAsCSV(java.lang.String filename,
                               int decimalPlaces,
                               char delimiter)
        Write the dataset as CSV file.
        Parameters:
        filename - Filename.
        decimalPlaces - Decimal places for continous data.
        delimiter - Delimiter.
      • WriteAsCSV

        public void WriteAsCSV(java.lang.String filename,
                               int decimalPlaces,
                               char delimiter,
                               java.lang.String newLine)
        Write the dataset as CSV file.
        Parameters:
        filename - Filename.
        decimalPlaces - Decimal places.
        delimiter - Delimiter.
        newLine - Newline char.
      • WriteAsCSV

        public void WriteAsCSV(java.lang.String filename,
                               int decimalPlaces,
                               char delimiter,
                               java.lang.String newLine,
                               boolean writeHeader)
        Write the dataset as CSV file.
        Parameters:
        filename - Filename.
        decimalPlaces - Decimal places.
        delimiter - Delimiter.
        newLine - Newline char.
        writeHeader - Write the header of the dataset.
      • WriteAsARFF

        public void WriteAsARFF(java.lang.String filename)
        Write dataset as ARFF file.
        Parameters:
        filename - Filename.
      • WriteAsARFF

        public void WriteAsARFF(java.lang.String filename,
                                int decimalPlaces)
        Write dataset as ARFF file.
        Parameters:
        filename - Filename.
        decimalPlaces - Decimal places.
      • setInput

        public void setInput(double[][] input,
                             DecisionVariable[] variables)
        Description copied from interface: IDataset
        Set the input data.
        Specified by:
        setInput in interface IDataset<double[][],double[]>
        Parameters:
        input - Input.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.