Ignore:
Timestamp:
11/09/17 18:03:06 (4 years ago)
Author:
gkronber
Message:

#2789 worked on sbart spline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MathNetNumerics-Exploration-2789/HeuristicLab.Algorithms.DataAnalysis.Experimental/GAM.cs

    r15457 r15468  
    2121
    2222using System;
    23 using System.Collections.Concurrent;
    2423using System.Collections.Generic;
    2524using System.Linq;
    2625using System.Threading;
    27 using System.Threading.Tasks;
    2826using HeuristicLab.Analysis;
    2927using HeuristicLab.Common;
    3028using HeuristicLab.Core;
    3129using HeuristicLab.Data;
    32 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3330using HeuristicLab.Optimization;
    3431using HeuristicLab.Parameters;
    3532using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3633using HeuristicLab.Problems.DataAnalysis;
    37 using HeuristicLab.Problems.DataAnalysis.Symbolic;
    38 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    3934
    4035namespace HeuristicLab.Algorithms.DataAnalysis.Experimental {
     
    228223          product = product.Zip(problemData.Dataset.GetDoubleValues(inputVars[i], problemData.TrainingIndices), (pi, vi) => pi * vi).ToArray();
    229224        }
    230         // CubicSplineGCV.CubGcvReport report;
    231         // return CubicSplineGCV.CalculateCubicSpline(
    232         //   product,
    233         //   (double[])target.Clone(),
    234         //   problemData.TargetVariable, inputVars, out report
    235         //   );
     225        CubicSplineGCV.CubGcvReport report;
     226        return CubicSplineGCV.CalculateCubicSpline(
     227          product,
     228          (double[])target.Clone(),
     229          problemData.TargetVariable, inputVars, out report
     230          );
    236231
    237232        double optTolerance; double cvRMSE;
     
    274269        // return Splines.CalculatePenalizedRegressionSpline(product, (double[])target.Clone(), lambda, problemData.TargetVariable, inputVars, out avgTrainRMSE, out cvRMSE, out bestPredictions);
    275270        SBART.SBART_Report rep;
    276         var model = SBART.CalculateSBART(product, (double[])target.Clone(), problemData.TargetVariable, inputVars, (float)lambda, out rep);
     271        var model = SBART.CalculateSBART(product, (double[])target.Clone(), problemData.TargetVariable, inputVars, out rep);
    277272        Console.WriteLine("{0} {1:N5} {2:N5} {3:N5} {4:N5}", string.Join(",", inputVars), rep.gcv, rep.leverage.Sum(), product.StandardDeviation(), target.StandardDeviation());
    278273        return model;
Note: See TracChangeset for help on using the changeset viewer.