Comments (4)
I should note that in python I can use model.classes_
to get the class values. I guess my question boils down to how can I do this in your library (which seems awesome btw)?
from leaves.
@NikEyX , thanks for your interest to leaves
and sorry for late response.
Unfortunately, you can't obtain this information from xgboost's binary model file, because there is no such information.. Let me explain this by details:
- When you use
XGBClassifier.fit
in python it performs labels encoding fory
, let's say labels1242, 1152, 1552, 1242
goes to0, 1, 2, 0
by using sklearn'sLabelEncoder
. Then only labels like0, 1, 2, ..
goes to xgboost core library, and model obtained can operate only these labels.. - There are warnings in
XGBClassifier.save/load_model
that points on that also:
The model is saved in an XGBoost internal binary format which is
universal among the various XGBoost interfaces. Auxiliary attributes of
the Python Booster object (such as feature names) will not be loaded.
Label encodings (text labels to numeric labels) will be also lost.
**If you are using only the Python interface, we recommend pickling the
model object for best results.
So, python xgboost bindings will be also lost original class labels after save_mode -> load_model operations.
from leaves.
btw, util.SigmoidFloat64SliceInplace
is not what you want to use in class of multi class classification. In that case you would use softmax transformation on raw tress values in order to obtain probabilities of classes occurrences. Sum of all class probabilities should be 1.0 (this is a property of softmax function).
Currently I'm developing an update for leaves
that make it possible apply transformation on tree results (sigmoid for binary classification, softmax for multi class classification, lambda rank for rank problems and so on). Stay tuned!
from leaves.
good to know, thanks for the updates! Love your work, keep it up!
from leaves.
Related Issues (20)
- Leaves can't load xgboost model which trained for java api? HOT 1
- Is there the plan for xgboost Ranker with rank:pairwise?
- Prediction result always be 0.000 HOT 1
- How complicated would it be to provide the model training part as well?
- Support for returning feature_name in Ensemble struct
- support v3 model encoding HOT 2
- is this library compatible with catboost? HOT 3
- Total incorrect python xgboost train model,use leaves load model and predict HOT 2
- NOutputGroups always be 0 HOT 9
- only version=v2 is supported HOT 1
- Could you please add support for lambdarank(lambdamart)?
- Support for newer versions of XGBoost HOT 2
- Does for the LightGBM have support for missing values
- Question: support for objective:quantile
- Support the use of sklearn pipelines with prediction model
- what's exactly meanings of some parameters?
- The prediction is wrong when using XGEnsembleFromFile to load model
- How to deal with missing values for xgboost
- Is there any way to support tweedie regression models?
- predict result different with python HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaves.