Repository navigation
Fix dataset loading and off-by-one errors in Pima diabetes example - #254
vaibhavc-coder wants to merge 3 commits into
Conversation
rcurtin
left a comment
There was a problem hiding this comment.
I'm surprised to have so many comments on a simple PR, but, we can significantly simplify the changes that you made here.
| */ | ||
| #include <mlpack.hpp> | ||
| #include <sstream> | ||
| #include <iostream> |
There was a problem hiding this comment.
You don't need this, it is already included by mlpack.hpp.
| { | ||
| std::cerr << "Failed to load the dataset." << std::endl; | ||
| return 1; | ||
| } |
There was a problem hiding this comment.
Why not just use Fatal in the call to Load()? Also, we should change from data::Load() to Load() since that changed in upstream mlpack recently. See https://www.mlpack.org/doc/user/load_save.html for the documentation.
There was a problem hiding this comment.
Thanks for the review! I switched to Load() with mlpack::Fatal and removed the redundant include and extra blank lines. I’ve pushed the updates to this PR.
| //iterations, [> Number of optimization steps. <] | ||
| //"output.gif" [> Output file. <]); | ||
| } | ||
|
|
There was a problem hiding this comment.
We don't need to add an extra line here.
rcurtin
left a comment
There was a problem hiding this comment.
Thanks, I appreciate the fixes.
…tes.cpp Co-authored-by: Ryan Curtin <ryan@ratml.org>
Fixes #253.
This PR adds a check for dataset loading failures so that the program exits gracefully if the dataset cannot be loaded.
It also fixes the slicing indices in two places where the program was displaying 11 samples instead of the intended 10.
The changes are limited to the fixes discussed in #253.
Thanks for the feedback!