use num_cpus; use rafor::prelude::*; use rafor::rf::Regressor;
fn main() {
#[rustfmt::skip]
let dataset = [
0.7, 0.0,
0.8, 1.0,
0.3, 0.0,
1.0, 1.3,
0.4, 2.1
];
let targets = [0.8, 0.2, 0.7, 0.3, 1.2];
let predictor = Regressor::trainer()
.with_max_depth(15)
.with_trees(40)
.with_threads(num_cpus::get())
.with_seed(42)
.train(&dataset, &targets);
let predictions = predictor.predict(&dataset, num_cpus::get());
println!("Predictions: {:?}", predictions);
}