O'Reilly logo

C# Machine Learning Projects by Yoon Hyup Hwang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Model validations 

Before we start looking into the performances of the linear regression and SVM models that we built in the previous section, let's refresh our memory on the metrics and the diagnostics plot we discussed in the previous chapter. We are going to look at RMSE, R2, and a plot of actual versus predicted values to evaluate the performances of our models. The code we are going to use throughout this section for model evaluation is as follows:

private static void ValidateModelResults(string modelName, double[] regInSamplePreds, double[] regOutSamplePreds, double[][] trainX, double[] trainY, double[][] testX, double[] testY){    // RMSE for in-sample  double regInSampleRMSE = Math.Sqrt(new SquareLoss(trainX).Loss(regInSamplePreds)); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required