|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwater.Iced
water.OldModel
hex.rf.RFModel
public class RFModel
A model is an ensemble of trees that can be serialized and that can be used to classify data.
Field Summary | |
---|---|
int |
_features
Number of features these trees are built for |
Key[][] |
_localForests
Local forests produced by nodes |
int[] |
_nodesSplitFeatures
Number of computed split features per node - number of split features can differ for each node. |
Key[][] |
_remoteChunksKeys
Remote chunks' keys used by individual nodes |
float |
_sample
Sampling rate used when building trees. |
Sampling.Strategy |
_samplingStrategy
Sampling strategy used for model |
int |
_splitFeatures
Number of split features defined by user. |
float[] |
_strataSamples
Strata sampling rate used for local-node strata-sampling |
long |
_time
Total time in seconds to produce model |
Key[] |
_tkeys
All the trees in the model |
int |
_totalTrees
Number of keys the model expects to be built for it |
byte[][] |
_trees
|
static java.lang.String |
KEY_PREFIX
|
Fields inherited from class water.OldModel |
---|
_dataKey, _selfKey, _va, DOC_FIELDS |
Constructor Summary | |
---|---|
RFModel()
Empty constructor for deserialization |
|
RFModel(Key selfKey,
int[] cols,
Key dataKey,
Key[] tkeys,
int features,
Sampling.Strategy samplingStrategy,
float sample,
float[] strataSamples,
int splitFeatures,
int totalTrees)
A RandomForest Model |
|
RFModel(Key selfKey,
java.lang.String[] colNames,
java.lang.String[] classNames,
Key[] tkeys,
int features,
float sample)
|
Method Summary | |
---|---|
int |
classes()
|
short |
classify(int[] votes,
double[] classWt,
java.util.Random rand)
|
short |
classify(ValueArray data,
AutoBuffer chunk,
int row,
int[] modelDataMap,
int[] votes,
double[] classWt,
java.util.Random rand)
|
short |
classify0(int tree_id,
ValueArray data,
AutoBuffer chunk,
int row,
int[] modelDataMap,
short badrow)
Classify a row according to one particular tree. |
void |
deleteKeys()
Bad name, I know. |
Counter |
depth()
|
void |
find_leaves_depth()
Internal computation of depth and number of leaves. |
long |
getTreeSeed(int i)
Return the random seed used to sample this tree. |
Counter |
leaves()
|
static RFModel |
make(RFModel old,
Key tkey,
int nodeIdx)
|
static Key |
makeKey()
|
java.lang.String |
name(int atree)
|
float |
progress()
|
protected double |
score0(double[] data)
Single row scoring, on properly ordered data |
protected double |
score0(ValueArray data,
AutoBuffer ab,
int row_in_chunk)
Bulk scoring API, on a compatible ValueArray (when pushed throw the mapping) |
protected double |
score0(ValueArray data,
int row)
Single row scoring, on a compatible ValueArray (when pushed throw the mapping) |
int |
size()
|
com.google.gson.JsonObject |
toJson()
|
byte[] |
tree(int tree_id)
Return the bits for a particular tree |
int |
treeCount()
The number of trees in this model. |
Methods inherited from class water.OldModel |
---|
adapt, adapt, columnFilter, columnMapping, delete, fromJson, identityMap, isCompatible, isCompatible, isCompatible, response, responseName, score, score |
Methods inherited from class water.Iced |
---|
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int _features
public Sampling.Strategy _samplingStrategy
public float _sample
public float[] _strataSamples
public int _splitFeatures
public int[] _nodesSplitFeatures
public int _totalTrees
public Key[] _tkeys
public Key[][] _localForests
public Key[][] _remoteChunksKeys
public long _time
public transient byte[][] _trees
public static final java.lang.String KEY_PREFIX
Constructor Detail |
---|
public RFModel(Key selfKey, int[] cols, Key dataKey, Key[] tkeys, int features, Sampling.Strategy samplingStrategy, float sample, float[] strataSamples, int splitFeatures, int totalTrees)
treeskey
- a key of keys of treesclasses
- the number of response classesdata
- the datasetpublic RFModel(Key selfKey, java.lang.String[] colNames, java.lang.String[] classNames, Key[] tkeys, int features, float sample)
public RFModel()
Method Detail |
---|
public static RFModel make(RFModel old, Key tkey, int nodeIdx)
public static final Key makeKey()
public int treeCount()
public int size()
public int classes()
public float progress()
progress
in interface Job.Progress
public java.lang.String name(int atree)
public byte[] tree(int tree_id)
public void deleteKeys()
public short classify0(int tree_id, ValueArray data, AutoBuffer chunk, int row, int[] modelDataMap, short badrow)
tree_id
- the number of the tree to usechunk
- the chunk we are usingrow
- the row number in the chunkmodelDataMap
- mapping from model/tree columns to data columns
public short classify(ValueArray data, AutoBuffer chunk, int row, int[] modelDataMap, int[] votes, double[] classWt, java.util.Random rand)
public short classify(int[] votes, double[] classWt, java.util.Random rand)
public void find_leaves_depth()
public Counter leaves()
public Counter depth()
public long getTreeSeed(int i)
protected double score0(double[] data)
score0
in class OldModel
protected double score0(ValueArray data, int row)
score0
in class OldModel
protected double score0(ValueArray data, AutoBuffer ab, int row_in_chunk)
score0
in class OldModel
public com.google.gson.JsonObject toJson()
toJson
in class OldModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |