linfa 0.8.1

A Machine Learning framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
+++
title = "Multi Targets"
+++
```rust
// assume we have a dataset with multiple,
// uncorrelated targets and we want to train
// a single model for each target variable
let model = train.target_iter()
    .map(|x| params.fit(&x).unwrap())
    .collect::<MultiTarget<_, _>>()?;

// composing `model` returns multiple targets
let valid_est = model.predict(valid);
println!("{}", valid_est.ntargets());
```