Skip to content
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

Unwrap in Stats #105

Open
isabella opened this issue Feb 24, 2022 · 2 comments
Open

Unwrap in Stats #105

isabella opened this issue Feb 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@isabella
Copy link
Contributor

error: panicked at 'called `Option::unwrap()` on a `None` value', crates/core/stats.rs:365:48
   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: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   9: tangram_core::stats::Stats::finalize
  10: tangram_core::train::Trainer::prepare
  11: tangram::main
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: _main
@isabella isabella added the bug Something isn't working label Feb 24, 2022
@isabella
Copy link
Contributor Author

This happens here:

let min = self.histogram.iter().next().unwrap().0.get();

https://github.com/tangramdotdev/tangram/blob/d3472c217f0177872d40628425ea0241bb3afb24/crates/core/stats.rs#L365

@MitchyGoodness
Copy link

Hey @isabella, do you happen to have the original training data that triggered this bug?
Based on this comment, I would assume the issue was caused by the histogram size exceeding 100 as set here. However, when I trained using heart_disease.csv and selecting resting_blood_pressure as the target, the issue did not reoccur. I was able to confirm, the histogram size exceeded the limit but it did not panic when unwrapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants