xiaodaigh / JLBoost.jl

A 100%-Julia implementation of Gradient-Boosting Regression Tree algorithms
MIT License
72 stars 6 forks source link

Support Matrix Inputs #15

Open xiaodaigh opened 4 years ago

baggepinnen commented 4 years ago

This would be great! I have always found DataFrames to be clunky and pretty much never use them. My inputs are often low-dimensional embeddings without any real names, making putting them in a dataframe just an extra step.

Edit: Actually I find it really hard to figure out how to make it work, Tables.jl does not seem to speak to my intuition

julia> jlboost(Tables.table([A y], header=[:A1, :A2, :A3, :y]), :y)
ERROR: MethodError: no method matching view(::Tables.MatrixRow{Array{Float64,2}}, ::BitArray{1})
xiaodaigh commented 4 years ago

Thanks for raising it. If you didn't, I wouldn't know what feature ppl would find useful. That's quite a different perspective, I created JLBoost partly because I didn't like the lack of support for DataFrames. I guess, some ppl would prefer matrices. So it's higher up on the cards

JLBoost supports Tables.jl so unless the recent API change broke it then it should work if you just defined three methods, see https://github.com/xiaodaigh/JLBoost.jl#tablesjl-integration

If doing that would mean type piracy then I have to think about this. I think implementing nrow, ncol and view is a good idea in general anyway.