The Startup
Published in

The Startup

Building Linear Regression in Python

Yes, I know — there is a built in function in the python numpy module that does linear (and other powers) fitting. It looks like this.

m,b = polyfit(x, y, 1)

But what if you are using VPython (Glowscript)? This is the online version of python with the built in visual module. It has awesome stuff for making graphs, vector calculations, and even 3D visualizations. But what if you want to use Glowscript AND find a linear function that best fits some points or data? What then?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store