example: classifying dogs with a naïve Bayes model#131
Hidden character warning
example: classifying dogs with a naïve Bayes model#131zackmdavis wants to merge 1 commit intoAtheMathmo:masterfrom
Conversation
|
... except that CI doesn't know that the example needs the |
|
I love the context for the example! I have a few comments for the example code. I think it needs some more inline comments and hand holding. Maybe we can try to separate out the data-creation and the machine learning parts too. But really it only needs some mild changes. I guess the bigger issue is the feature flag... I'll see if I can find a way to fix that using the |
|
OK; sometime in the next few days I'll add comments and change it to use |
Great, thank you! I've merged in #133 which has some breaking changes (going into the 0.5.0 release). Let me know if you need any help resolving. It's mostly modifications to trait imports and some behind-the-scenes naive bayes changes (shouldn't affect you). |
This in the matter of AtheMathmo#128.
828c67a to
2bae9ac
Compare
|
(updated and force-pushed) |
AtheMathmo
left a comment
There was a problem hiding this comment.
It's a lot better (perhaps good enough) but I still feel like we need a little more explanation. Do you think I'm being a bit too cautious?
| if accurate { | ||
| hits += 1; | ||
| } | ||
| println!("Predicted: {:?}; Actual: {:?}; Accurate? {:?}", |
There was a problem hiding this comment.
I'm not sure we want to print so many lines to our users terminal - maybe we just store the last 10 or so and print these?
| } | ||
|
|
||
| // Train! | ||
| let mut model = NaiveBayes::<naive_bayes::Gaussian>::new(); |
There was a problem hiding this comment.
I think we should give some more information to the reader here (briefly of course). Why do we choose Gaussian?
|
|
||
| #### Dog Classification | ||
|
|
||
| Suppose we have a population composed of red dogs and white dogs, whose friendliness, furriness, and speed can be measured. The group of white dogs is friendlier, furrier, and slower than red dogs by one standard deviation (respectively), but given the color of a dog, friendliness, furriness, and speed are independent of each other. We can use a naïve Bayes model to try to predict dog color given friendliness, furriness, and speed as observations. |
There was a problem hiding this comment.
I think another paragraph with a little more technical detail would be good. In particular I think it's worthwhile to address:
- What kind of Naive Bayes' do we use? Why?
- As the example is quite large - maybe walk through roughly what we do? Randomly generate some dogs, convert them into
Matrixform for rusty-machine. Create model, train model, predict from model on unknown dogs. Assess accuracy.
What do you think? Perhaps there is already enough information there for new users - it certainly makes sense to me but I'm not a good reference point!
|
OK; more commentary later |
|
@zackmdavis did you need anything from me for this? Not rushing you at all - take as long as you like! |
|
Alternatively, merge now and accept improvements later if I (or—we can unrealistically hope—someone else) happen to get around to it?? |
This in the matter of #128.