data-science

Data science, data analysis, and machine learning in Clojure https://scicloj.github.io/pages/chat_streams/ for additional discussions
jumar 2020-06-05T12:01:06.256900Z

What do you use to plot histograms (and possibly other charts) with Clojure? I have some data in CSV and want to visualize it quickly.

2020-06-05T12:46:06.257300Z

If you have ClojureScript, I use plotly

2020-06-05T12:46:19.257600Z

or on Clojure you can use plotly with libpython-clj

2020-06-05T12:46:48.258Z

Most Clojurians use oz or saite/hanami

2020-06-05T13:20:30.260300Z

I've been happy with clj-plot for things lately, but that is because I need to generate a lot of static charts for pdfs

jumar 2020-06-05T13:21:05.260400Z

I don't have ClojureScript. I like Oz but it looks rather low-level for this stuff (no built-in charts?) I was looking for something like incanter's histogram but more flexible and nicer.

2020-06-05T13:29:37.260700Z

Try libpython-clj

2020-06-05T13:29:37.260900Z

then

phoenixjj 2020-06-05T14:12:35.261800Z

I have used incanter for generating histogram. You can find example in this repo > https://github.com/phoenix2082/punter

jumar 2020-06-05T16:57:37.263900Z

Thanks for the pointers. I ended up playing with Oz and it wasn’t too hard to draw basic histograms

👍 1
🎉 1
practicalli-john 2020-06-05T17:49:28.267200Z

Oz is fairly simple once you realise it's just a hash-map I did a number of example in Clojure here https://github.com/practicalli/oz-visualisations And some more info here. https://practicalli.github.io/blog/posts/visualising-uk-covid19-data-with-oz/ You can also use the vega-lite examples, as JavaScript or converting to Clojure

okwori 2020-06-06T15:35:20.295300Z

Do we have a fix as to why the arc pie chart is not displaying/throwing an exception yet...

2020-06-05T18:17:52.271Z

Hey @jumar! Thanks for giving Oz a shot. And thanks to @jr0cket for sharing those resources.

2020-06-05T18:26:38.276400Z

One thing to keep in mind: As far as charting is concerned, Oz is really just Vega-Lite and Vega under the hood. And as you've discovered, Vega-Lite in particular really is pretty easy to use for basic use cases. However, I hope you also find (as I and others have) that it's also really good at "growing with you" in power & expressiveness as you find yourself needing to do more detailed and interactive visualizations. It's really just a great framework.

➕ 2
2020-06-05T18:29:28.278900Z

Finally, a number of other tools in the ecosystem (such as Saite, Hanami, Darkstar, Gorilla-REPL) also use Vega & Vega-Lite, so the grammar is very portable, and you're got some choices as far as tooling that fits your preferences & context.

2020-06-05T18:29:40.279300Z

Please enjoy responsibly!

mauricio.szabo 2020-06-05T18:33:35.280900Z

I also added a support for custom visualizations on Chlorine (socket-REPL package for Atom), so if there's someone that already use it, ping me (there's like... zero documentation so far, and it's still crude, but it works 😄)

❤️ 1
2020-06-05T18:37:29.283300Z

Yes; Didn't mean to leave your tooling out above @mauricio.szabo, but it seems to further highlight just how much clj(s) support there is out there for Vega now!

mauricio.szabo 2020-06-05T18:39:46.285900Z

@metasoarous no problem, I don't really remember if I already published that Atom now have support for this kind of extension 🙂 (But, I don't know if Chlorine works with Vega... probably you will have to do some wiring by hand, because when you require vega on Atom it requires as a Node.JS library and don't find "canvas" or something)

mauricio.szabo 2020-06-05T18:40:11.286500Z

But, if you can require a library in JS, it probably works with Chlorine now 🙂.

2020-06-05T18:41:00.287Z

Oh; My bad. I may have misunderstood when you said "support for custom visualizations".

2020-06-05T18:41:58.287700Z

I look forward to seeing the docs on that then.

chrisn 2020-06-05T23:18:07.289600Z

There is another option. If you want to be strictly server-side you can use darkstar just to convert a vega json string into an svg and render that. https://github.com/applied-science/darkstar

👍 1
💯 1
❤️ 2
2020-06-08T18:41:08.299100Z

Yup; For the record, I mentioned Darkstar above 🙂

2020-06-08T18:41:53.299300Z

And doesn't http://tech.ml.dataset have some basic vega utilities?

chrisn 2020-06-08T22:47:32.306900Z

Sorry, yes I see that now. I just quickly scanned. Not any more, everything like that was moved to tech.viz. That is why I now have the simpledata repository that people can just and then use immediately; the tech system now requires 3 separate dependencies if you want to train a classifier and see a plot of the output.

2020-06-09T00:23:47.307100Z

Dope 🙂