-
Notifications
You must be signed in to change notification settings - Fork 327
Rust extension - XGBoost #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pgml_rust/src/lib.rs
Outdated
/// | ||
/// ``` | ||
/// SELECT * FROM pgml_train('pgml.diabetes', ARRAY['age', 'sex'], 'target'); | ||
#[pg_extern] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[pg_extern] | |
#[pg_extern] | |
#[search_path(pgml, public)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pgml
schema is not used in this one, at least not yet. I'm building this parallel to pgml
in pgml_rust
, so this can be used as an optimization for available algorithms.
pgml_rust/src/lib.rs
Outdated
let features = features.iter().map(|column| format!("CAST({} AS REAL)", column)).collect::<Vec<String>>(); | ||
|
||
let query = format!( | ||
"SELECT {}, CAST({} AS REAL) FROM {} ORDER BY RANDOM()", features.clone().join(", "), label, table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this how you're getting around select * from foo
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, everything coming in is guaranteed to be a REAL
so we can get is as value::<f32>()
* Rust XGBoost POC * README * vendor * cleanup * remove submodule * readme * Vendor * readme * Cleaner * version * move files
Adding Rust XGBoost POC:
Latency per prediction varies between 0.9ms and 6ms.