Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2344 for trunk


Ignore:
Timestamp:
09/08/09 11:11:50 (15 years ago)
Author:
gkronber
Message:

Extended IAnalyzerModel and the default implementation AnalyzerModel to hold a dictionary of result values and extended GP algorithms for time-series prognosis and classification to store specific results (TheilInequalityCoefficient and Accuracy in the model) (#736). Also prepared IAnalyzerModel and AnalyzerModel and modeling algorithms to store meta-information about models (#731).

Location:
trunk/sources
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/DefaultClassificationAlgorithmOperators.cs

    r2341 r2344  
    5555      testAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
    5656
    57       ConfusionMatrixEvaluator trainingConfusionMatrix = new ConfusionMatrixEvaluator();
    58       trainingConfusionMatrix.Name = "TrainingConfusionMatrixEvaluator";
    59       trainingConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TrainingConfusionMatrix";
    60       trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
    61       trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
    62 
    63       ConfusionMatrixEvaluator validationConfusionMatrix = new ConfusionMatrixEvaluator();
    64       validationConfusionMatrix.Name = "ValidationConfusionMatrixEvaluator";
    65       validationConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "ValidationConfusionMatrix";
    66       validationConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
    67       validationConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
    68 
    69       ConfusionMatrixEvaluator testConfusionMatrix = new ConfusionMatrixEvaluator();
    70       testConfusionMatrix.Name = "TestConfusionMatrixEvaluator";
    71       testConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TestConfusionMatrix";
    72       testConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
    73       testConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
    74 
    7557      individualProc.AddSubOperator(trainingAccuracy);
    7658      individualProc.AddSubOperator(validationAccuracy);
    7759      individualProc.AddSubOperator(testAccuracy);
    78       individualProc.AddSubOperator(trainingConfusionMatrix);
    79       individualProc.AddSubOperator(validationConfusionMatrix);
    80       individualProc.AddSubOperator(testConfusionMatrix);
    8160      return seq;
    8261    }
     
    9271      return op;
    9372    }
     73
     74    internal static void SetModelData(IAnalyzerModel model, IScope scope) {
     75      model.SetResult("TrainingAccuracy", scope.GetVariableValue<DoubleData>("TrainingAccuracy", true).Data);
     76      model.SetResult("ValidationAccuracy", scope.GetVariableValue<DoubleData>("ValidationAccuracy", true).Data);
     77      model.SetResult("TestAccuracy", scope.GetVariableValue<DoubleData>("TestAccuracy", true).Data);
     78    }
    9479  }
    9580}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs

    r2341 r2344  
    3434      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
    3535    }
     36
     37    protected override IAnalyzerModel CreateGPModel() {
     38      IAnalyzerModel model = base.CreateGPModel();
     39      DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     40      return model;
     41    }
    3642  }
    3743}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs

    r2341 r2344  
    2727namespace HeuristicLab.GP.StructureIdentification.Classification {
    2828  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, IClassificationAlgorithm {
     29    protected override IOperator CreateProblemInjector() {
     30      return DefaultClassificationAlgorithmOperators.CreateProblemInjector();
     31    }
     32   
    2933    protected override IOperator CreatePostProcessingOperator() {
    3034      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     35    }
     36
     37    protected override IAnalyzerModel CreateGPModel() {
     38      IAnalyzerModel model = base.CreateGPModel();
     39      DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     40      return model;
    3141    }
    3242  }
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/DefaultTimeSeriesOperators.cs

    r2341 r2344  
    9494      return seq;
    9595    }
     96
     97    internal static void SetModelData(IAnalyzerModel model, IScope scope) {
     98      model.SetResult("TrainingTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("TrainingTheilInequalityCoefficient", true).Data);
     99      model.SetResult("ValidationTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("ValidationTheilInequalityCoefficient", true).Data);
     100      model.SetResult("TestTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("TestTheilInequalityCoefficient", true).Data);
     101    }
    96102  }
    97103}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs

    r2341 r2344  
    6565    }
    6666
     67    protected override IAnalyzerModel CreateGPModel() {
     68      IAnalyzerModel model = base.CreateGPModel();
     69      DefaultTimeSeriesOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     70      return model;
     71    }
    6772  }
    6873}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs

    r2341 r2344  
    6363      return injector;
    6464    }
     65
     66    protected override IAnalyzerModel CreateGPModel() {
     67      IAnalyzerModel model = base.CreateGPModel();
     68      DefaultTimeSeriesOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     69      return model;
     70    }
    6571  }
    6672}
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/DefaultStructureIdentificationOperators.cs

    r2341 r2344  
    282282      model.TestSamplesEnd = bestModelScope.GetVariableValue<IntData>("TestSamplesEnd", true).Data;
    283283
    284       model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TrainingMSE", false).Data;
    285       model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationMSE", false).Data;
    286       model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestMSE", false).Data;
    287       model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
    288       model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
    289       model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
    290       model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
    291       model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
    292       model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
    293       model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
    294       model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
    295       model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
    296       model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
    297       model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
    298       model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
     284      model.SetResult("TrainingMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("TrainingMSE", false).Data);
     285      model.SetResult("ValidationMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("ValidationMSE", false).Data);
     286      model.SetResult("TestMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("TestMSE", false).Data);
     287      model.SetResult("TrainingCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data);
     288      model.SetResult("ValidationCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data);
     289      model.SetResult("TestCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data);
     290      model.SetResult("TrainingMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data);
     291      model.SetResult("ValidationMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data);
     292      model.SetResult("TestMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data);
     293      model.SetResult("TrainingMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data);
     294      model.SetResult("ValidationMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data);
     295      model.SetResult("TestMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data);
     296      model.SetResult("TrainingVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data);
     297      model.SetResult("ValidationVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data);
     298      model.SetResult("TestVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data);
     299
     300      model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue<DoubleData>("EvaluatedSolutions", true).Data);
     301      IGeneticProgrammingModel gpModel = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("FunctionTree", true);
     302      model.SetMetaData("TreeSize", gpModel.Size);
     303      model.SetMetaData("TreeHeight", gpModel.Height);
    299304
    300305      ItemList evaluationImpacts = bestModelScope.GetVariableValue<ItemList>("VariableEvaluationImpacts", false);
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGP.cs

    r2341 r2344  
    146146    }
    147147
    148     private IAnalyzerModel CreateGPModel() {
     148    protected virtual IAnalyzerModel CreateGPModel() {
    149149      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
    150       return DefaultStructureIdentificationAlgorithmOperators.CreateGPModel(bestModelScope);
     150      IAnalyzerModel model = DefaultStructureIdentificationAlgorithmOperators.CreateGPModel(bestModelScope);
     151      model.SetMetaData("SelectionPressure", bestModelScope.GetVariableValue<DoubleData>("SelectionPressure", true).Data);
     152      return model;
    151153    }
    152154  }
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs

    r2341 r2344  
    145145    }
    146146
    147     private IAnalyzerModel CreateGPModel() {
     147    protected virtual IAnalyzerModel CreateGPModel() {
    148148      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
    149       return DefaultStructureIdentificationAlgorithmOperators.CreateGPModel(bestModelScope);
     149      IAnalyzerModel model = DefaultStructureIdentificationAlgorithmOperators.CreateGPModel(bestModelScope);
     150      return model;
    150151    }
    151152  }
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs

    r2341 r2344  
    276276      IAnalyzerModel model = new AnalyzerModel();
    277277      model.Predictor = bestModelScope.GetVariableValue<IPredictor>("Predictor", true);
    278       model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TrainingQuality", false).Data;
    279       model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
    280       model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
    281       model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
    282       model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
    283       model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
    284       model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
    285       model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
    286       model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
    287       model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
    288       model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
    289       model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
    290       model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
    291       model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
    292       model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
     278      model.SetResult("TrainingMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("TrainingQuality", false).Data);
     279      model.SetResult("ValidationMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data);
     280      model.SetResult("TestMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data);
     281      model.SetResult("TrainingCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data);
     282      model.SetResult("ValidationCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data);
     283      model.SetResult("TestCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data);
     284      model.SetResult("TrainingMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data);
     285      model.SetResult("ValidationMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data);
     286      model.SetResult("TestMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data);
     287      model.SetResult("TrainingMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data);
     288      model.SetResult("ValidationMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data);
     289      model.SetResult("TestMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data);
     290      model.SetResult("TrainingVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data);
     291      model.SetResult("ValidationVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data);
     292      model.SetResult("TestVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data);
     293
     294      IGeneticProgrammingModel gpModel = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("LinearRegressionModel", false);
     295      model.SetMetaData("TreeSize", gpModel.Size);
     296      model.SetMetaData("TreeHeight", gpModel.Height);
    293297
    294298      HeuristicLab.DataAnalysis.Dataset ds = bestModelScope.GetVariableValue<Dataset>("Dataset", true);
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs

    r2339 r2344  
    3838      Connect();
    3939      if (!ctx.DatabaseExists())
    40         ctx.CreateDatabase();     
     40        ctx.CreateDatabase();
    4141    }
    4242
     
    109109
    110110      using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
    111         //get all double properties to save as modelResult
    112         IEnumerable<PropertyInfo> modelResultInfos = model.GetType().GetProperties().Where(
    113           info => info.PropertyType == typeof(double));
    114         foreach (PropertyInfo modelResultInfo in modelResultInfos) {
    115           Result result = GetOrCreateResult(modelResultInfo.Name);
    116           double value = (double)modelResultInfo.GetValue(model, null);
    117           ctx.ModelResults.InsertOnSubmit(new ModelResult(m, result, value));
     111        foreach (KeyValuePair<string, double> pair in model.Results) {
     112          Result result = GetOrCreateResult(pair.Key);
     113          ctx.ModelResults.InsertOnSubmit(new ModelResult(m, result, pair.Value));
    118114        }
    119115        ctx.SubmitChanges();
    120116      }
     117
     118      // code to store meta-information for models (gkronber (8.9.09))
     119      //using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
     120      //  foreach (KeyValuePair<string, double> pair in model.MetaData) {
     121      //    MetaData metaData = GetOrCreateMetaData(pair.Key);
     122      //    ctx.ModelMetaData.InsertOnSubmit(new ModelMetaData(m, metaData, pair.Value));
     123      //  }
     124      //  ctx.SubmitChanges();
     125      //}
    121126
    122127      using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
  • trunk/sources/HeuristicLab.Modeling/3.2/AnalyzerModel.cs

    r2285 r2344  
    6161    }
    6262
    63     private double trainingMSE;
    64     public double TrainingMeanSquaredError {
    65       get { return trainingMSE; }
    66       set { trainingMSE = value; }
     63    private Dictionary<string, double> results = new Dictionary<string, double>();
     64    public IEnumerable<KeyValuePair<string, double>> Results {
     65      get { return results; }
    6766    }
    6867
    69     private double validationMSE;
    70     public double ValidationMeanSquaredError {
    71       get { return validationMSE; }
    72       set { validationMSE = value; }
     68    public void SetResult(string name, double value) {
     69      results.Add(name, value);
    7370    }
    7471
    75     private double testMSE;
    76     public double TestMeanSquaredError {
    77       get { return testMSE; }
    78       set { testMSE = value; }
     72    public double GetResult(string name) {
     73      return results[name];
    7974    }
    8075
    81     public double TrainingMeanAbsolutePercentageError {
    82       get;
    83       set;
     76    private Dictionary<string, object> metadata = new Dictionary<string, object>();
     77    public IEnumerable<KeyValuePair<string, object>> MetaData {
     78      get { return metadata; }
    8479    }
    8580
    86     public double ValidationMeanAbsolutePercentageError {
    87       get;
    88       set;
     81    public void SetMetaData(string name, object value) {
     82      metadata.Add(name, value);
    8983    }
    9084
    91     public double TestMeanAbsolutePercentageError {
    92       get;
    93       set;
    94     }
    95 
    96     public double TrainingMeanAbsolutePercentageOfRangeError {
    97       get;
    98       set;
    99     }
    100 
    101     public double ValidationMeanAbsolutePercentageOfRangeError {
    102       get;
    103       set;
    104     }
    105 
    106     public double TestMeanAbsolutePercentageOfRangeError {
    107       get;
    108       set;
    109     }
    110 
    111     public double TrainingCoefficientOfDetermination {
    112       get;
    113       set;
    114     }
    115 
    116     public double ValidationCoefficientOfDetermination {
    117       get;
    118       set;
    119     }
    120 
    121     public double TestCoefficientOfDetermination {
    122       get;
    123       set;
    124     }
    125 
    126     public double TrainingVarianceAccountedFor {
    127       get;
    128       set;
    129     }
    130 
    131     public double ValidationVarianceAccountedFor {
    132       get;
    133       set;
    134     }
    135 
    136     public double TestVarianceAccountedFor {
    137       get;
    138       set;
     85    public object GetMetaData(string name) {
     86      return metadata[name];
    13987    }
    14088
  • trunk/sources/HeuristicLab.Modeling/3.2/IAnalyzerModel.cs

    r2285 r2344  
    2727
    2828namespace HeuristicLab.Modeling {
    29    public interface IAnalyzerModel {
     29  public interface IAnalyzerModel {
     30    IPredictor Predictor { get; set; }
    3031    Dataset Dataset { get; set; }
    3132    string TargetVariable { get; set; }
    3233    IEnumerable<string> InputVariables { get; }
     34    IEnumerable<KeyValuePair<string, double>> Results { get; }
     35    IEnumerable<KeyValuePair<string, object>> MetaData { get; }
    3336    int TrainingSamplesStart { get; set; }
    3437    int TrainingSamplesEnd { get; set; }
     
    3740    int TestSamplesStart { get; set; }
    3841    int TestSamplesEnd { get; set; }
    39     double TrainingMeanSquaredError { get; set; }
    40     double ValidationMeanSquaredError { get; set; }
    41     double TestMeanSquaredError { get; set; }
    42     double TrainingMeanAbsolutePercentageError { get; set; }
    43     double ValidationMeanAbsolutePercentageError { get; set; }
    44     double TestMeanAbsolutePercentageError { get; set; }
    45     double TrainingMeanAbsolutePercentageOfRangeError { get; set; }
    46     double ValidationMeanAbsolutePercentageOfRangeError { get; set; }
    47     double TestMeanAbsolutePercentageOfRangeError { get; set; }
    48     double TrainingCoefficientOfDetermination { get; set; }
    49     double ValidationCoefficientOfDetermination { get; set; }
    50     double TestCoefficientOfDetermination { get; set; }
    51     double TrainingVarianceAccountedFor { get; set; }
    52     double ValidationVarianceAccountedFor { get; set; }
    53     double TestVarianceAccountedFor { get; set; }
     42    void SetResult(string name, double value);
     43    double GetResult(string name);
     44    void SetMetaData(string name, object data);
     45    object GetMetaData(string name);
    5446    double GetVariableEvaluationImpact(string variableName);
    5547    double GetVariableQualityImpact(string variableName);
     
    5749    void SetVariableEvaluationImpact(string variableName, double impact);
    5850    void SetVariableQualityImpact(string variableName, double impact);
    59     IPredictor Predictor { get; set; }
    6051  }
    6152}
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r2328 r2344  
    412412      qualImpactCalc.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
    413413      qualImpactCalc.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
    414      
     414
    415415      seqProc.AddSubOperator(predictorBuilder);
    416416      seqProc.AddSubOperator(evalImpactCalc);
     
    425425    protected internal virtual IAnalyzerModel CreateSVMModel(IScope bestModelScope) {
    426426      AnalyzerModel model = new AnalyzerModel();
    427       model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data;
    428       model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
    429       model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
    430       model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingR2", false).Data;
    431       model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
    432       model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
    433       model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPE", false).Data;
    434       model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
    435       model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
    436       model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPRE", false).Data;
    437       model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
    438       model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
    439       model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingVAF", false).Data;
    440       model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
    441       model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
     427      model.SetResult("TrainingMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data);
     428      model.SetResult("ValidationMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data);
     429      model.SetResult("TestMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data);
     430      model.SetResult("TrainingCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("ActualTrainingR2", false).Data);
     431      model.SetResult("ValidationCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data);
     432      model.SetResult("TestCoefficientOfDetermination", bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data);
     433      model.SetResult("TrainingMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPE", false).Data);
     434      model.SetResult("ValidationMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data);
     435      model.SetResult("TestMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data);
     436      model.SetResult("TrainingMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPRE", false).Data);
     437      model.SetResult("ValidationMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data);
     438      model.SetResult("TestMeanAbsolutePercentageOfRangeError", bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data);
     439      model.SetResult("TrainingVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("ActualTrainingVAF", false).Data);
     440      model.SetResult("ValidationVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data);
     441      model.SetResult("TestVarianceAccountedFor", bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data);
     442
     443      model.SetMetaData("Cost", bestModelScope.GetVariableValue<DoubleData>("Cost", false).Data);
     444      model.SetMetaData("Nu", bestModelScope.GetVariableValue<DoubleData>("Nu", false).Data);
    442445
    443446      HeuristicLab.DataAnalysis.Dataset ds = bestModelScope.GetVariableValue<Dataset>("Dataset", true);
Note: See TracChangeset for help on using the changeset viewer.