I am trying some basic machine learning with Mathematica. I am wondering if I can see the function that Mathematica produces for a training set. I give the following example:
trainingset = {1 -> 1.3, 2 -> 2.4, 3 -> 4.4, 4 -> 5.1, 6 -> 7.3}; p = Predict[trainingset, Method -> "LinearRegression"]
If I type p[1.5], it will give me the predicted value. However, could I also see/know somehow the function used, e.g. for this case in the form of y=a*x+b, (where x is the variable)? Is there a way to see the predicted function?
p[[1]]
and you'll see the internals. An important thing to realize is that the resulting linear regression model is fit against the standardized data, not the original data. This is quite common for Mathematica to pre-standardize before learning, and it makes extracting the model a bit awkward because the parameters have to be un-standardized properly. See here for example with SVMs mathematica.stackexchange.com/questions/233099/… $\endgroup$