Package adams.ml.data

Class DatasetUtils


  • public class DatasetUtils
    extends SpreadSheetHelper
    Helper methods for Dataset objects.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • DatasetUtils

        public DatasetUtils()
    • Method Detail

      • getNumericColumns

        public static int[] getNumericColumns​(Dataset data)
        Determines the numeric columns in a dataset.
        Parameters:
        data - the dataset to inspect
        Returns:
        the indices of the numeric columns
      • numericToJama

        public static Jama.Matrix numericToJama​(Dataset data)
        Turns all the numeric columns into a Jama Matrix.
        Parameters:
        data - the data to convert
        Returns:
        the generated matrix
      • numericToJama

        public static Jama.Matrix numericToJama​(Dataset data,
                                                int[] cols)
        Turns the specified numeric columns into a Jama Matrix.
        Parameters:
        data - the data to convert
        cols - the numeric columns to use
        Returns:
        the generated matrix
      • numericToMatrixAlgo

        public static com.github.waikatodatamining.matrix.core.Matrix numericToMatrixAlgo​(Dataset data)
        Turns all the numeric columns into a Jama Matrix.
        Parameters:
        data - the data to convert
        Returns:
        the generated matrix
      • numericToMatrixAlgo

        public static com.github.waikatodatamining.matrix.core.Matrix numericToMatrixAlgo​(Dataset data,
                                                                                          int[] cols)
        Turns the specified numeric columns into a Jama Matrix.
        Parameters:
        data - the data to convert
        cols - the numeric columns to use
        Returns:
        the generated matrix
      • numericToArrays

        public static List<double[]> numericToArrays​(Dataset data)
        Turns all the numeric columns into a list of double arrays.
        Parameters:
        data - the data to convert
        Returns:
        the generated arrays
      • numericToArrays

        public static List<double[]> numericToArrays​(Dataset data,
                                                     int[] cols)
        Turns the specified numeric columns into a list of double arrays.
        Parameters:
        data - the data to convert
        cols - the numeric columns to use
        Returns:
        the generated arrays
      • matrixAlgoToSpreadSheet

        public static SpreadSheet matrixAlgoToSpreadSheet​(com.github.waikatodatamining.matrix.core.Matrix data,
                                                          String colPrefix)
        Returns the matrix as spreadsheet.
        Parameters:
        data - the matrix to convert
        colPrefix - the prefix for the columns
        Returns:
        the generated spreadsheet