rusty-machine icon indicating copy to clipboard operation
rusty-machine copied to clipboard

Pretty pictures for documentation

Open theotherphil opened this issue 9 years ago • 7 comments

I like the example classifications from sckit-learn: http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html.

I've implemented the same sort of thing for my WIP randomforest library in a "demo" crate and it should be easy to do the same for the classifiers in this library.

e.g. classifying points in a plane using a forest containing hyperplane classifiers (coloured dots are the input data, other points are coloured by the weighted sum of their predicted classes):

Predictions

Do you have any interest in me doing this? I'm not sure the pictures are all that helpful, but they might catch the eye of people reading the readme! If I do add this where should the code go? It depends on imageproc, which pulls in a load of dependencies.

Not a big deal if you're not interested :-)

theotherphil avatar Sep 20 '16 21:09 theotherphil

Of course I would love more pretty pictures in the documentation! However - I'm not sure that the README is necessarily the best place for this (it probably is right now).

So I have thought about this a little before and decided that I didn't want to add any examples directly into the rusty-machine repo. I'd prefer the examples to be about explaining library usage. I may be open to changing my mind though. I definitely don't want to include these as part of the rusty-machine project though - mostly as I don't want to litter the manifest (even with devDependencies).

With that said - there are some existing demo examples. Though I'm not sure they qualify as pretty. I created a demo image-compression project which uses rusty-machine. And I also worked on learning-machines. I plan on working on the latter a little more when I have some time - though making it pretty is way outside my area of expertise...

I think in the future I'd like to see pretty examples given as feature cases in the README. Maybe a Projects featuring rusty-machine section? Of course - for this to be valuable we need some more projects using rusty-machine :).

AtheMathmo avatar Sep 20 '16 22:09 AtheMathmo

Ok, sure. I've added an inline example to the original post. Learning-machines looks like it might be a good match for this sort of visualisation. I don't know anything about web development but I might have a go at adding something there. Feel free to close this issue.

theotherphil avatar Sep 21 '16 05:09 theotherphil

I'd love for you to take a look at learning-machines!

I'll keep this issue open (for a little while) as I feel like others may have opinions on it too. I'm sure it would help to catch more people's attention if we could clearly show what the library is capable of.

AtheMathmo avatar Sep 21 '16 05:09 AtheMathmo

I thought a little more about this today. I think perhaps a good idea would be to have examples which can produce pretty graphics on their own, through libraries like dataplotlib. This library in particular isn't quite there yet but I think it is good thing to work towards.

AtheMathmo avatar Nov 05 '16 15:11 AtheMathmo

I'm not completely sure what you mean. The linked example produces these visualisations 'on its own'.

theotherphil avatar Nov 05 '16 17:11 theotherphil

It might be that we are both describing the same thing!

I meant that instead of producing graphics and putting them in documentation we could write examples, which would live in the examples folder, and would produce these graphics when the user ran them (cargo run --example classify-plot) and display them to the user.

The advantage being they become part of our test cycle (cargo test compiles examples), and we don't have to carefully maintain the graphics in lots of docs.

On Nov 5, 2016, at 5:14 PM, theotherphil <[email protected]mailto:[email protected]> wrote:

I'm not completely sure what you mean. The linked example produces these visualisations 'on its own'.

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/AtheMathmo/rusty-machine/issues/129#issuecomment-258625850, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJrkStgTdluNyVvtjCmgb48U0wKcTpAjks5q7LlxgaJpZM4KCK9Q.

AtheMathmo avatar Nov 05 '16 17:11 AtheMathmo

Ah right. Yes, that's how I was imagining this would work. The image in the first comment is generated by running randomforest-demo using the example input data.

theotherphil avatar Nov 05 '16 19:11 theotherphil