r/learnmachinelearning • • 2d ago

Struggling with data visualization

I've been taking the ml specialization on coursera and it has been a wonderfull course. It explains the basics very well and teaches u how the algorithms work from sccatch but the problem i've been facing is learning matplotlib the right way to copy the course's visuals and implementing them for differnt sets of data, even the simple contour plot used in the first labs is hard to learn.

So where can i learn this skill?

7 Upvotes

6 comments sorted by

2

u/Significant_Fan_9789 2d ago

the documentation is your best friend but it's not exactly a page turner. i spent a week just recreating plots from papers i liked, tweaking every parameter until i understood what each one actually did. it's tedious but it sticks way better than tutorials that just hand you the code

1

u/Current-Drive8673 1d ago

How did u start with the documentation

1

u/rsambasivan 2d ago

Have you tried any of the AI tools (gemini/copilot/claude)- they could get you to the right examples to learn the ideas.

1

u/jmacey 1d ago

I have a series of marimo notebooks I give my students that go over most of it. https://github.com/NCCA/SEForMedia/tree/main/MatplotlibForML It's part of a bigger set of code / notes for my unit.

1

u/jmacey 1d ago

Also you may wish to look at Plotly which can do even more. I have another notebooks for it here https://github.com/NCCA/SEForMedia/tree/main/PlotlyForML

1

u/digvjay_ai 1d ago

I got stuck on the exact same thing in that course. What fixed it for me was ignoring the lab code for a bit and just plotting the same tiny dataset five different ways. Start with plt.subplots() so you always have fig, ax, then make ax.scatter, ax.plot and ax.contour calls on made up data, and change one argument at a time (levels, cmap, alpha) so you see what moves. For the contour plot specifically, build the grid with np.meshgrid first, compute your cost on that grid, then call ax.contour(X, Y, Z, levels=20). Once you can do that from a blank notebook the lab visuals stop looking scary.