public class XGModelParser extends Object implements ModelParser<NamedVector,Double,XGModelComposition>
grammar XGBoostModel; YES : 'yes' ; NO : 'no' ; MISSING : 'missing' ; EQ : '=' ; COMMA : ',' ; PLUS : '+' ; MINUS : '-' ; DOT : '.' ; EXP : 'E' | 'e' ; BOOSTER : 'booster' ; LBRACK : '[' ; RBRACK : ']' ; COLON : ':' ; LEAF : 'leaf' ; INT : (PLUS | MINUS)? [0-9]+ ; DOUBLE : INT DOT [0-9]* (EXP INT)?; STRING : [A-Za-z_][0-9A-Za-z_]+ ; NEWLINE : '\r' '\n' | '\n' | '\r' ; LT : '<' ; WS : ( ' ' | '\t' )+ -> skip ; xgValue : DOUBLE | INT ; xgHeader : BOOSTER LBRACK INT RBRACK COLON? ; xgNode : INT COLON LBRACK STRING LT xgValue RBRACK YES EQ INT COMMA NO EQ INT COMMA MISSING EQ INT ; xgLeaf : INT COLON LEAF EQ xgValue ; xgTree : xgHeader NEWLINE ( ((xgLeaf | xgNode) NEWLINE)+ ((xgLeaf | xgNode) EOF)? | ((xgLeaf | xgNode) NEWLINE)* (xgLeaf | xgNode) EOF ) ; xgModel : xgTree+ ;
Constructor and Description |
---|
XGModelParser() |
Modifier and Type | Method and Description |
---|---|
XGModelComposition |
parse(byte[] mdl)
Accepts serialized model represented by byte array, parses it and returns
Model . |
public XGModelComposition parse(byte[] mdl)
Model
.parse
in interface ModelParser<NamedVector,Double,XGModelComposition>
mdl
- Serialized model represented by byte array.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024