Search in sources :

Example 6 with RowData

use of hex.genmodel.easy.RowData in project h2o-3 by h2oai.

the class PredictCsv method formatDataRow.

private static RowData formatDataRow(String[] splitLine, String[] inputColumnNames) {
    // Assemble the input values for the row.
    RowData row = new RowData();
    int maxI = Math.min(inputColumnNames.length, splitLine.length);
    for (int i = 0; i < maxI; i++) {
        String columnName = inputColumnNames[i];
        String cellData = splitLine[i];
        switch(cellData) {
            case "":
            case "NA":
            case "N/A":
            case "-":
                continue;
            default:
                row.put(columnName, cellData);
        }
    }
    return row;
}
Also used : RowData(hex.genmodel.easy.RowData)

Example 7 with RowData

use of hex.genmodel.easy.RowData in project h2o-3 by h2oai.

the class GenMunger method fillDefault.

public RowData fillDefault(String[] vals) {
    RowData row = new RowData();
    String[] types = inTypes();
    String[] names = inNames();
    for (int i = 0; i < types.length; ++i) row.put(names[i], vals == null ? null : valueOf(types[i], vals[i]));
    return row;
}
Also used : RowData(hex.genmodel.easy.RowData)

Aggregations

RowData (hex.genmodel.easy.RowData)7 EasyPredictModelWrapper (hex.genmodel.easy.EasyPredictModelWrapper)2 BufferedWriter (java.io.BufferedWriter)2 FileReader (java.io.FileReader)2 FileWriter (java.io.FileWriter)2 CSVReader (au.com.bytecode.opencsv.CSVReader)1 ModelCategory (hex.ModelCategory)1 GenModel (hex.genmodel.GenModel)1 GenMunger (hex.genmodel.GenMunger)1 PredictException (hex.genmodel.easy.exception.PredictException)1 RegressionModelPrediction (hex.genmodel.easy.prediction.RegressionModelPrediction)1 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1 URL (java.net.URL)1 StreamingSchema (water.api.StreamingSchema)1 BufferedString (water.parser.BufferedString)1