public abstract class MojoModel extends GenModel
| Modifier and Type | Class and Description |
|---|---|
static interface |
MojoModel.MojoReader |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_balanceClasses |
protected ModelCategory |
_category |
protected double |
_defaultThreshold |
protected double[] |
_modelClassDistrib |
protected int |
_nclasses |
protected int |
_nfeatures |
protected double[] |
_priorClassDistrib |
protected MojoModel.MojoReader |
_reader |
protected boolean |
_supervised |
protected java.lang.String |
_uuid |
_domains, _names, _offsetColumn| Modifier | Constructor and Description |
|---|---|
protected |
MojoModel(MojoModel.MojoReader cr,
java.util.Map<java.lang.String,java.lang.Object> info,
java.lang.String[] columns,
java.lang.String[][] domains) |
| Modifier and Type | Method and Description |
|---|---|
ModelCategory |
getModelCategory()
Returns this model category.
|
java.lang.String |
getUUID()
Returns model's unique identifier.
|
boolean |
isSupervised()
Returns true for supervised models.
|
static MojoModel |
load(MojoModel.MojoReader mojoReader)
Advanced way of constructing Mojo models by supplying a custom mojoReader.
|
static MojoModel |
load(java.lang.String file)
Primary factory method for constructing MojoModel instances.
|
int |
nclasses()
Returns number of output classes for classifiers, 1 for regression models, and 0 for unsupervised models.
|
int |
nfeatures()
Returns number of input features.
|
bitSetContains, correctProbabilities, GBM_rescale, getColIdx, getDomainValues, getDomainValues, getDomainValues, getHeader, getNames, getNumClasses, getNumCols, getNumResponseClasses, getPrediction, getPredsSize, getResponseIdx, getResponseName, GLM_identityInv, GLM_inverseInv, GLM_logInv, GLM_logitInv, GLM_tweedieInv, isAutoEncoder, isClassifier, KMeans_closest, KMeans_distance, KMeans_distance, KMeans_simplex, log_rescale, map, mapEnum, predict, predict, score0, score0, score0, score0, score0protected transient MojoModel.MojoReader _reader
protected ModelCategory _category
protected java.lang.String _uuid
protected boolean _supervised
protected int _nfeatures
protected int _nclasses
protected boolean _balanceClasses
protected double _defaultThreshold
protected double[] _priorClassDistrib
protected double[] _modelClassDistrib
protected MojoModel(MojoModel.MojoReader cr, java.util.Map<java.lang.String,java.lang.Object> info, java.lang.String[] columns, java.lang.String[][] domains)
public static MojoModel load(java.lang.String file) throws java.io.IOException
file - Name of the zip file (or folder) with the model's data. This should be the data retrieved via
the `GET /3/Models/{model_id}/mojo` endpoint.java.io.IOException - if `file` does not exist, or cannot be read, or does not represent a valid model.public static MojoModel load(MojoModel.MojoReader mojoReader) throws java.io.IOException
mojoReader - a class that implements the MojoModel.MojoReader interface.java.io.IOException - if the mojoReader doespublic boolean isSupervised()
GenModelisSupervised in interface IGenModelisSupervised in class GenModelpublic int nfeatures()
GenModelpublic int nclasses()
GenModelpublic ModelCategory getModelCategory()
GenModelgetModelCategory in interface IGenModelgetModelCategory in class GenModelModelCategorypublic java.lang.String getUUID()
IGeneratedModelgetUUID in interface IGeneratedModelgetUUID in class GenModel