Changeset 14375
- Timestamp:
- 11/07/16 08:40:42 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/ElasticNetLinearRegression.cs
r14374 r14375 135 135 RunElasticNetLinearRegression(Problem.ProblemData, Penality, out lambda, out trainNMSE, out testNMSE, out coeff, out intercept); 136 136 137 var coeffTable = new IndexedDataTable<double>("Coefficient Paths", "The paths of standarized coefficient values over different lambda values");137 var coeffTable = new IndexedDataTable<double>("Coefficients", "The paths of standarized coefficient values over different lambda values"); 138 138 coeffTable.VisualProperties.YAxisMaximumAuto = false; 139 139 coeffTable.VisualProperties.YAxisMinimumAuto = false; … … 143 143 coeffTable.VisualProperties.XAxisLogScale = true; 144 144 coeffTable.VisualProperties.XAxisTitle = "Log10(Lambda)"; 145 coeffTable.VisualProperties.YAxisTitle = "Coefficient value";145 coeffTable.VisualProperties.YAxisTitle = "Coefficients"; 146 146 coeffTable.VisualProperties.SecondYAxisTitle = "Number of variables"; 147 147 … … 175 175 Results.Add(new Result(coeffTable.Name, coeffTable.Description, coeffTable)); 176 176 177 var nmsePlot= new IndexedDataTable<double>("NMSE", "Path of NMSE values over different lambda values");178 nmsePlot.VisualProperties.YAxisMaximumAuto = false;179 nmsePlot.VisualProperties.YAxisMinimumAuto = false;180 nmsePlot.VisualProperties.XAxisMaximumAuto = false;181 nmsePlot.VisualProperties.XAxisMinimumAuto = false;182 183 nmsePlot.VisualProperties.YAxisMinimumFixedValue = 0;184 nmsePlot.VisualProperties.YAxisMaximumFixedValue = 1.0;185 nmsePlot.VisualProperties.XAxisLogScale = true;186 nmsePlot.VisualProperties.XAxisTitle = "Log10(Lambda)";187 nmsePlot.VisualProperties.YAxisTitle = "Normalized mean of squared errors (NMSE)";188 nmsePlot.VisualProperties.SecondYAxisTitle= "Number of variables";189 nmsePlot.Rows.Add(new IndexedDataRow<double>("NMSE (train)", "Path of NMSE values over different lambda values", lambda.Zip(trainNMSE, (l, v) => Tuple.Create(l, v))));190 nmsePlot.Rows.Add(new IndexedDataRow<double>("NMSE (test)", "Path of NMSE values over different lambda values", lambda.Zip(testNMSE, (l, v) => Tuple.Create(l, v))));191 nmsePlot.Rows.Add(new IndexedDataRow<double>("Number of variables", "The number of non-zero coefficients for each step in the path", lambda.Zip(numNonZeroCoeffs, (l, v) => Tuple.Create(l, (double)v))));177 var errorTable = new IndexedDataTable<double>("NMSE", "Path of NMSE values over different lambda values"); 178 errorTable.VisualProperties.YAxisMaximumAuto = false; 179 errorTable.VisualProperties.YAxisMinimumAuto = false; 180 errorTable.VisualProperties.XAxisMaximumAuto = false; 181 errorTable.VisualProperties.XAxisMinimumAuto = false; 182 183 errorTable.VisualProperties.YAxisMinimumFixedValue = 0; 184 errorTable.VisualProperties.YAxisMaximumFixedValue = 1.0; 185 errorTable.VisualProperties.XAxisLogScale = true; 186 errorTable.VisualProperties.XAxisTitle = "Log10(Lambda)"; 187 errorTable.VisualProperties.YAxisTitle = "Normalized mean of squared errors (NMSE)"; 188 errorTable.VisualProperties.SecondYAxisTitle= "Number of variables"; 189 errorTable.Rows.Add(new IndexedDataRow<double>("NMSE (train)", "Path of NMSE values over different lambda values", lambda.Zip(trainNMSE, (l, v) => Tuple.Create(l, v)))); 190 errorTable.Rows.Add(new IndexedDataRow<double>("NMSE (test)", "Path of NMSE values over different lambda values", lambda.Zip(testNMSE, (l, v) => Tuple.Create(l, v)))); 191 errorTable.Rows.Add(new IndexedDataRow<double>("Number of variables", "The number of non-zero coefficients for each step in the path", lambda.Zip(numNonZeroCoeffs, (l, v) => Tuple.Create(l, (double)v)))); 192 192 if (lambda.Length > 2) { 193 nmsePlot.VisualProperties.XAxisMinimumFixedValue = Math.Pow(10, Math.Floor(Math.Log10(lambda.Last()))); 194 nmsePlot.VisualProperties.XAxisMaximumFixedValue = Math.Pow(10, Math.Ceiling(Math.Log10(lambda.Skip(1).First()))); 195 } 196 nmsePlot.Rows["NMSE (train)"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 197 nmsePlot.Rows["NMSE (test)"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 198 nmsePlot.Rows["Number of variables"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 199 nmsePlot.Rows["Number of variables"].VisualProperties.SecondYAxis = true; 200 201 202 Results.Add(new Result(nmsePlot.Name, nmsePlot.Description, nmsePlot)); 193 errorTable.VisualProperties.XAxisMinimumFixedValue = Math.Pow(10, Math.Floor(Math.Log10(lambda.Last()))); 194 errorTable.VisualProperties.XAxisMaximumFixedValue = Math.Pow(10, Math.Ceiling(Math.Log10(lambda.Skip(1).First()))); 195 } 196 errorTable.Rows["NMSE (train)"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 197 errorTable.Rows["NMSE (test)"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 198 errorTable.Rows["Number of variables"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points; 199 errorTable.Rows["Number of variables"].VisualProperties.SecondYAxis = true; 200 201 Results.Add(new Result(errorTable.Name, errorTable.Description, errorTable)); 203 202 } 204 203
Note: See TracChangeset
for help on using the changeset viewer.