Treelite
Functions
xgboost_json.cc File Reference

Frontend for xgboost model. More...

#include "xgboost/xgboost_json.h"
#include <fmt/format.h>
#include <rapidjson/error/en.h>
#include <rapidjson/document.h>
#include <rapidjson/filereadstream.h>
#include <treelite/tree.h>
#include <treelite/frontend.h>
#include <treelite/math.h>
#include <treelite/logging.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <memory>
#include <queue>
#include <string>
#include <utility>
#include "xgboost/xgboost.h"
Include dependency graph for xgboost_json.cc:

Go to the source code of this file.

Functions

std::unique_ptr< treelite::ModelLoadXGBoostJSONModel (const char *filename)
 load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble in the JSON format. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostJSONModelString (const char *json_str, size_t length)
 load an XGBoost model from a JSON string More...
 

Detailed Description

Frontend for xgboost model.

Copyright (c) 2020-2021 by Contributors

Author
Hyunsu Cho
William Hicks

Definition in file xgboost_json.cc.

Function Documentation

◆ LoadXGBoostJSONModel()

std::unique_ptr< treelite::Model > LoadXGBoostJSONModel ( const char *  filename)

load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble in the JSON format.

Parameters
filenamename of model file
Returns
loaded model

Definition at line 42 of file xgboost_json.cc.

◆ LoadXGBoostJSONModelString()

std::unique_ptr< treelite::Model > LoadXGBoostJSONModelString ( const char *  json_str,
size_t  length 
)

load an XGBoost model from a JSON string

Parameters
json_strJSON char array
lengthlength of JSON char array
Returns
loaded model

Definition at line 82 of file xgboost_json.cc.