public final class DataUtils
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
static double[] | 
arrayFromString(java.lang.String s)  | 
static double[] | 
arrayFromString(java.lang.String s,
               java.lang.String delemiter)  | 
static double[] | 
arrayFromString(java.lang.String s,
               java.lang.String delemiter,
               boolean trim)  | 
static double[] | 
average(double[] a,
       int processes)  | 
static double[] | 
combineLabelAndData(double[] x,
                   double y)
This method combines the label and features in the data point
 This can be use to submit a single message in the stream 
 | 
static BinaryBatchModel | 
generateBinaryModel(double[][] xy,
                   int iterations,
                   double alpha)
Deprecated. 
 
method 
 | 
static double[][] | 
generateDummyDataPoints(int samples,
                       int features)
This method provides a dummy data set for batch based computations
 User can say the number of samples and feature size and this function
 generates a data set with labels included per data sample 
 | 
static double[][] | 
getDataObjectToDoubleArray(DataObject<java.lang.Object> dataPointsObject1)  | 
static double[][] | 
getDataPointsFromDataObject(java.lang.Object object)
This method is used to convert the input data obtained from a different SourceTask 
 | 
static double[][] | 
getWeightVectorFromDataObject(java.lang.Object object)
This method is used to convert the input data obtained from a different SourceTask 
 | 
static double[] | 
seedDoubleArray(int features)
This method populates the array with a Gaussian Distribution 
 | 
static BinaryBatchModel | 
updateModelData(BinaryBatchModel binaryBatchModel,
               double[][] xy)
This method updates an existing BinaryBatchModel with the data points 
 | 
public static double[] seedDoubleArray(int features)
features - : number of features in a data pointpublic static double[] combineLabelAndData(double[] x,
                                           double y)
x - data points with d featuresy - labelpublic static double[][] generateDummyDataPoints(int samples,
                                                 int features)
samples - number of data points = Nfeatures - number of features in a data point = D@Deprecated public static BinaryBatchModel generateBinaryModel(double[][] xy, int iterations, double alpha)
xy - data points with {y_i, x_i_1, .... x_i_d}iterations - number of iterationsalpha - learning ratepublic static BinaryBatchModel updateModelData(BinaryBatchModel binaryBatchModel, double[][] xy)
binaryBatchModel - Binary Batch Modelxy - data points with {y_i, x_i_1, .... x_i_d}public static double[][] getDataPointsFromDataObject(java.lang.Object object)
public static double[][] getWeightVectorFromDataObject(java.lang.Object object)
public static double[][] getDataObjectToDoubleArray(DataObject<java.lang.Object> dataPointsObject1)
public static double[] arrayFromString(java.lang.String s)
public static double[] arrayFromString(java.lang.String s,
                                       java.lang.String delemiter)
public static double[] arrayFromString(java.lang.String s,
                                       java.lang.String delemiter,
                                       boolean trim)
public static double[] average(double[] a,
                               int processes)