Once again we point to the Kadenze course on how to use Wekinator for real-time interactive ML:
Machine Learning for Artists & Musicians (Covering Wekinator)
In the video below the creator of Wekinator covers the use of an Application (avaliable here) to experiment with Linear and Polynomial Regression in a visual way. Creating a dataset by clicking points and then training and viewing the model output. The application is also available as a Processing sketch if you want to examine how the code works. (Note: this software was used in the video for demonstration).
Classification and Regression are two types of supervised machine learning. In the video we point out that Classification predicts whether an input is one of any number of distinct categories or classes. Regression predicts a numerical output for an input.
If you are interested in the math behind linear regression or how it might be implemented in code. The video below is a nice succinct summary of the math.