Open
Description
When training a binary classification model, the CLI crashes with the following output:
error: panicked at 'called `Option::unwrap()` on a `None` value', crates/core/train.rs:1729:22
0: backtrace::capture::Backtrace::new
1: tangram::train::train::{{closure}}
2: std::panicking::rust_panic_with_hook
3: std::panicking::begin_panic_handler::{{closure}}
4: std::sys_common::backtrace::__rust_end_short_backtrace
5: _rust_begin_unwind
6: core::panicking::panic_fmt
7: core::panicking::panic
8: tangram_core::train::Trainer::test_and_assemble_model
9: tangram::main
10: std::sys_common::backtrace::__rust_begin_short_backtrace
11: _main
https://github.com/tangramdotdev/tangram/blob/2e51ef1ae3c7ec1e65b9232945d5cfb6d99d52ef/crates/core/train.rs#L1882
We handled this in the regression case here https://github.com/tangramdotdev/tangram/blob/2e51ef1ae3c7ec1e65b9232945d5cfb6d99d52ef/crates/core/train.rs#L1857
by removing the unwrap
and outputtting a friendly error message. We need to do the same for binary classification and multiclass classification.