public class ModelJsonReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MODEL_DETAILS_FILE |
Constructor and Description |
---|
ModelJsonReader() |
Modifier and Type | Method and Description |
---|---|
static boolean |
elementExists(com.google.gson.JsonElement jsonElement,
java.lang.String jsonPath) |
static void |
fillObject(java.lang.Object object,
com.google.gson.JsonElement from,
java.lang.String elementPath) |
static <T> void |
fillObjects(java.util.List<T> objects,
com.google.gson.JsonArray from) |
protected static com.google.gson.JsonElement |
findInJson(com.google.gson.JsonElement jsonElement,
java.lang.String jsonPath)
Finds an element in GSON's JSON document representation
|
static com.google.gson.JsonObject |
parseModelJson(MojoReaderBackend mojoReaderBackend) |
static Table |
readTable(com.google.gson.JsonObject modelJson,
java.lang.String tablePath)
Extracts a Table from H2O's model serialized into JSON.
|
static Table[] |
readTableArray(com.google.gson.JsonObject modelJson,
java.lang.String tablePath)
Extracts a Table array from H2O's model serialized into JSON.
|
public static final java.lang.String MODEL_DETAILS_FILE
public static com.google.gson.JsonObject parseModelJson(MojoReaderBackend mojoReaderBackend)
mojoReaderBackend
- JsonObject
representing the deserialized Json.public static Table[] readTableArray(com.google.gson.JsonObject modelJson, java.lang.String tablePath)
modelJson
- Full JSON representation of a modeltablePath
- Path in the given JSON to the desired table array. Levels are dot-separated.Table
[], if there was a table array found by following the given path. Otherwise null.public static Table readTable(com.google.gson.JsonObject modelJson, java.lang.String tablePath)
modelJson
- Full JSON representation of a modeltablePath
- Path in the given JSON to the desired table. Levels are dot-separated.Table
, if there was a table found by following the given path. Otherwise null.public static <T> void fillObjects(java.util.List<T> objects, com.google.gson.JsonArray from)
public static void fillObject(java.lang.Object object, com.google.gson.JsonElement from, java.lang.String elementPath)
protected static com.google.gson.JsonElement findInJson(com.google.gson.JsonElement jsonElement, java.lang.String jsonPath)
jsonElement
- A (potentially complex) element to search injsonPath
- Path in the given JSON to the desired table. Levels are dot-separated.
E.g. 'model._output.variable_importances'.JsonNull
.public static boolean elementExists(com.google.gson.JsonElement jsonElement, java.lang.String jsonPath)
jsonElement
- A (potentially complex) element to search injsonPath
- Path in the given JSON to the desired table. Levels are dot-separated.
E.g. 'model._output.variable_importances'.