vaaaaanquish / lightgbm-rs

LightGBM Rust binding
MIT License
73 stars 30 forks source link

adding integration with polars #32

Closed benjaminjellis closed 3 years ago

benjaminjellis commented 3 years ago

Hi,

First off I've been playing around with the crate and I think it's really great.

One thing that I thought might be useful is to have integration with polars (i.e. something like pandas integration with sklearn in python)

I've added a new constructor method from_dataframe for the Dataset struct and packaged it under a new crate feature dataframe

I'm not sure if you're accepting contributions and whether a contribution like this would be something you'd want. Feel free to close the pr if not.

Let me know what you think!

Thanks :)

vaaaaanquish commented 3 years ago

@benjaminjellis Thx! It's great works! I'll review it within 3 days.

loxs commented 2 years ago

Hi, I'm getting this error

expected struct `polars_core::frame::DataFrame`, found struct `polars::prelude::DataFrame`

@benjaminjellis how are you using polars, are you using it from polars_core crate?

benjaminjellis commented 2 years ago

Hi @loxs,

The usage that's tested is using something like

use polars::df;

An example of this is here

i.e. this crate uses polars not polars_core.

Hopefully that helps! Any more questions lmk!

Thanks :)

loxs commented 2 years ago

Hm, it seems that it's because of polars version mismatch. I am using v 0.20 in the other parts of my software and this crate dpeneds on 0.16... seems like they did some reorg and types are no more compatible.

Thanks!