Comments (9)
This does indeed need to be fixed. Those are displayed with a "hacked together" dict because the parameters are not accessible via the xgboost API, so we have to store them separately.
Got it, thanks mate! this library is awesome, thanks again for all your work on this!
from xgboost.jl.
It was initially not clear to me how this used to work since the underlying C API only provides a method for setting a param to a single string value and eval_metric
doesn't seem to support string separators. After some digging, I've discovered that it seems to expect you to set certain params, e.g. eval_metric
via multiple separate calls. You can already do this via setparam!
. In this PR I have added the ability to set multiple params via an AbstractVector
or Tuple
, so your example should work after that PR.
from xgboost.jl.
@ExpandingMan : you are awesome mate! I will try this out when I am home.
Quick question: it looks like it will only work with Booster object. Does booster accept data frames? I particularly like how you support data frames in this api now.
Thanks!
from xgboost.jl.
Yes, DataFrame
are supported implicitly via the Tables.jl interface. Anything you see in the documentation that refers to a "table" also applies to a DataFrame
.
from xgboost.jl.
Awesome! Thanks a lot! The v2.0 is great and thanks for the documentation too!
from xgboost.jl.
hey mate, I am afraid I couldn't get it to work :(
bst = xgboost((view(df, :, [:col1, :col2]), view(trainView, :, col3)); num_round=10, XGBoost.classification(objective="binary:logistic", eval_metric= "auc")...)
XGBoost.setparam!(bst, "eval_metric", "aucpr")
XGBoost.setparam!(bst, "eval_metric", "logloss")
Output:
│ eval_metric auc │
│ │
│ objective binary:logistic │
- looks like setparam! overrides instead of appending to the eval_metric
- I cannot seem to get Booster to take DataFrames. from the doc below, it seems it can only take Matrices
https://dmlc.github.io/XGBoost.jl/dev/api/#XGBoost.Booster
thanks a lot for your help with this!
from xgboost.jl.
looks like setparam! overrides instead of appending to the eval_metric
It's definitely not going to properly display both values until the PR is merged. Can you check if it's working? I was able to get it to work this way. When that PR is merged the display should be fixed.
I cannot seem to get Booster to take DataFrames. from the doc below, it seems it can only take Matrices
It takes something called a DMatrix
which is just an internal xgboost wrapper for the data, but a DataFrame
should automatically get wrapped... for example
using XGBoost, DataFrames
df = DataFrame(a=randn(10), b=randn(10), y=randn(10))
Booster((df[:, [:a, :b]], df.y))
# or, alternatively
Booster(DMatrix(df, :y))
There are lots of different ways to pass the data (arguably too many), again, see the docs.
from xgboost.jl.
@ExpandingMan: thanks mate, you are a Star! I tried the below and can confirm that it includes the below metrics. At the risk of sounding pedantic, the XGBoost output doesn't have all metrics, just the last one.
thanks a lot, I appreciate your help and such a quick turnaround with this!
df = DataFrame(a=randn(10), b=randn(10), y=randn(10))
bst = xgboost((df[!, [:a, :b]], df.y),eval_metric=["rmse", "mae", "mape"])
Output:
[ Info: XGBoost: starting training.
[ Info: [1] train-rmse:1.05386554469353189 train-mae:0.85910702943801875 train-mape:3.26047090739011747
[ Info: [2] train-rmse:0.84753207030907596 train-mae:0.69181514382362364 train-mape:2.73415630133822551
It only shows "mape", I would have thought it would show all the metrics, i.e "rmse", "mae", "mape"
╭──── XGBoost.Booster ─────────────────────────────────────────────────────────────────╮
│ Features: ["a", "b"] │
│ │
│ Parameter Value │
│ ───────────────────────────────── │
│ eval_metric mape │
│ ───────────────────────────────── │
from xgboost.jl.
At the risk of sounding pedantic, the XGBoost output doesn't have all metrics, just the last one.
This does indeed need to be fixed. Those are displayed with a "hacked together" dict because the parameters are not accessible via the xgboost API, so we have to store them separately.
from xgboost.jl.
Related Issues (20)
- Package now requires a Julia built with GPL libraries enabled HOT 2
- early_stopping_rounds? HOT 18
- what is the role of sparse `DMatrix` constructors? HOT 24
- Can not reduce verbosity HOT 4
- XGBoost rewrite on Julia using Metal.jl HOT 8
- question on XGBoost_jll HOT 3
- TreeSHAP, libxgboost, and implications for predict function HOT 10
- Update term.jl dependency HOT 3
- Add GPU tests with buildkite
- Quick question on Custom objective HOT 3
- xgboost failing with julia 1.8.5 HOT 22
- issue finding libomp popped up after updating environment HOT 1
- xgboost fails to find libxgboost HOT 13
- Watchlist error HOT 1
- `predict` overwrites previously returned predictions HOT 2
- Saving and Loading Boosters HOT 13
- Precompile fails on Julia 1.10 HOT 5
- Saving and reloading boosters using IOBuffer HOT 5
- Occasional segfaults on m1 apple silicon HOT 2
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 xgboost.jl.