Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1922


Ignore:
Timestamp:
05/27/09 18:26:10 (16 years ago)
Author:
gkronber
Message:

#650 (IAlgorithm and derived interfaces should provide properties to retrieve results):

  • Implemented properties to retrieve model quality
  • Changed CEDMA executor to retrieve results via properties
  • Removed obsolete class Execution in CEDMA (replaced by the interface IAlgorithm)
Location:
trunk/sources
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs

    r1873 r1922  
    4444    }
    4545
    46     public Execution GetNextJob() {
     46    public IAlgorithm GetNextJob() {
    4747      // find and select a dataset
    4848      var dataSetVar = new HeuristicLab.CEDMA.DB.Interfaces.Variable("DataSet");
     
    6767
    6868      if (selectedAlgorithm != null) {
    69         Execution exec = CreateExecution(dataSet.Problem, targetVariable, selectedAlgorithm);
    70         exec.DataSetEntity = dataSetEntity;
    71         exec.TargetVariable = targetVariableName;
    72         return exec;
    73       } else return null;
     69        SetProblemParameters(selectedAlgorithm, dataSet.Problem, targetVariable);
     70      }
     71      return selectedAlgorithm;
    7472    }
    7573
     
    7876    public abstract IAlgorithm SelectAlgorithm(Entity dataSet, int targetVariable, LearningTask learningTask);
    7977
    80     private Execution CreateExecution(Problem problem, int targetVariable, IAlgorithm algorithm) {
    81       SetProblemParameters(algorithm, problem, targetVariable);
    82       Execution exec = new Execution(algorithm.Engine);
    83       exec.Description = algorithm.Name;
    84       return exec;
    85     }
    86 
    8778    private void SetProblemParameters(IAlgorithm algo, Problem problem, int targetVariable) {
    88       algo.ProblemInjector.GetVariable("Dataset").Value = problem.DataSet;
    89       algo.ProblemInjector.GetVariable("TargetVariable").GetValue<IntData>().Data = targetVariable;
     79      algo.Dataset = problem.DataSet;
     80      algo.TargetVariable = targetVariable;
    9081      algo.ProblemInjector.GetVariable("TrainingSamplesStart").GetValue<IntData>().Data = problem.TrainingSamplesStart;
    9182      algo.ProblemInjector.GetVariable("TrainingSamplesEnd").GetValue<IntData>().Data = problem.TrainingSamplesEnd;
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs

    r1898 r1922  
    3838using HeuristicLab.Core;
    3939using System.Threading;
     40using HeuristicLab.Modeling;
    4041
    4142namespace HeuristicLab.CEDMA.Server {
     
    6869    protected abstract void StartJobs();
    6970
    70     protected void StoreResults(Execution finishedExecution, IEngine finishedEngine) {
    71       Entity model = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    72       store.Add(new Statement(finishedExecution.DataSetEntity, Ontology.PredicateHasModel, model));
    73       StoreModelAttribute(model, Ontology.TargetVariable, finishedExecution.TargetVariable);
    74       StoreModelAttribute(model, Ontology.AlgorithmName, finishedExecution.Description);
    75       Scope bestModelScope = finishedEngine.GlobalScope.GetVariableValue<Scope>("BestValidationSolution", false);
    76       StoreModelVariable(model, Ontology.TrainingMeanSquaredError, bestModelScope, "Quality");
    77       StoreModelVariable(model, Ontology.ValidationMeanSquaredError, bestModelScope, "ValidationQuality");
    78       StoreModelVariable(model, Ontology.TestMeanSquaredError, bestModelScope, "TestQuality");
    79       StoreModelVariable(model, Ontology.TrainingMeanAbsolutePercentageError, bestModelScope, "TrainingMAPE");
    80       StoreModelVariable(model, Ontology.ValidationMeanAbsolutePercentageError, bestModelScope, "ValidationMAPE");
    81       StoreModelVariable(model, Ontology.TestMeanAbsolutePercentageError, bestModelScope, "TestMAPE");
    82       StoreModelVariable(model, Ontology.TrainingMeanAbsolutePercentageOfRangeError, bestModelScope, "TrainingMAPRE");
    83       StoreModelVariable(model, Ontology.ValidationMeanAbsolutePercentageOfRangeError, bestModelScope, "ValidationMAPRE");
    84       StoreModelVariable(model, Ontology.TestMeanAbsolutePercentageOfRangeError, bestModelScope, "TestMAPRE");
    85       StoreModelVariable(model, Ontology.TrainingCoefficientOfDetermination, bestModelScope, "TrainingR2");
    86       StoreModelVariable(model, Ontology.ValidationCoefficientOfDetermination, bestModelScope, "ValidationR2");
    87       StoreModelVariable(model, Ontology.TestCoefficientOfDetermination, bestModelScope, "TestR2");
    88       StoreModelVariable(model, Ontology.TrainingCoefficientOfDetermination, bestModelScope, "TrainingVAF");
    89       StoreModelVariable(model, Ontology.ValidationCoefficientOfDetermination, bestModelScope, "ValidationVAF");
    90       StoreModelVariable(model, Ontology.TestCoefficientOfDetermination, bestModelScope, "TestVAF");
    91       StoreModelVariable(model, Ontology.TrainingTheilsInequalityCoefficient, bestModelScope, "TrainingTheilInequalityCoefficient");
    92       StoreModelVariable(model, Ontology.ValidationTheilsInequalityCoefficient, bestModelScope, "ValidationTheilInequalityCoefficient");
    93       StoreModelVariable(model, Ontology.TestTheilsInequalityCoefficient, bestModelScope, "TestTheilInequalityCoefficient");
    94       StoreModelVariable(model, Ontology.TrainingAccuracy, bestModelScope, "TrainingAccuracy");
    95       StoreModelVariable(model, Ontology.ValidationAccuracy, bestModelScope, "ValidationAccuracy");
    96       StoreModelVariable(model, Ontology.TestAccuracy, bestModelScope, "TestAccuracy");
    97       StoreModelVariable(model, Ontology.TreeSize, bestModelScope, "TreeSize");
    98       StoreModelVariable(model, Ontology.TreeHeight, bestModelScope, "TreeHeight");
    99       StoreModelVariable(model, Ontology.EvaluatedSolutions, bestModelScope, "EvaluatedSolutions");
     71    protected void StoreResults(IAlgorithm finishedAlgorithm) {
     72      Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
     73      // TODO (gkronber 27052009)
     74      // store.Add(new Statement(finishedAlgorithm.DataSetEntity, Ontology.PredicateHasModel, modelEntity));
     75      StoreModelAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
     76      StoreModelAttribute(modelEntity, Ontology.AlgorithmName, finishedAlgorithm.Description);
     77     
     78      IModel model = finishedAlgorithm.Model;
     79      StoreModelAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);
     80      StoreModelAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);
     81      StoreModelAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);
     82      StoreModelAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);
     83      StoreModelAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);
     84      StoreModelAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);
     85      StoreModelAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);
     86      StoreModelAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);
     87      StoreModelAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);
     88      StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);
     89      StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);
     90      StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);
     91      StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);
     92      StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);
     93      StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
    10094
    101       byte[] serializedModel = PersistenceManager.SaveToGZip(bestModelScope.GetVariableValue("FunctionTree", false));
    102       store.Add(new Statement(model, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
    103     }
    104 
    105     private void StoreModelVariable(Entity model, Entity entity, Scope scope, string variableName) {
    106       if (scope.GetVariable(variableName) != null)
    107         StoreModelAttribute(model, entity, scope.GetVariableValue<ObjectData>(variableName, false).Data);
     95      byte[] serializedModel = PersistenceManager.SaveToGZip(model.Data);
     96      store.Add(new Statement(modelEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
    10897    }
    10998
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs

    r1898 r1922  
    3838using HeuristicLab.Core;
    3939using System.Threading;
     40using HeuristicLab.Modeling;
    4041
    4142namespace HeuristicLab.CEDMA.Server {
    4243  public class GridExecuter : ExecuterBase {
    4344    private JobManager jobManager;
    44     private Dictionary<WaitHandle, Execution> activeExecutions;
     45    private Dictionary<WaitHandle, IAlgorithm> activeAlgorithms;
    4546
    4647    private TimeSpan StartJobInterval {
     
    6667            Thread.Sleep(StartJobInterval);
    6768            // get an execution from the dispatcher and execute in grid via job-manager
    68             Execution execution = Dispatcher.GetNextJob();
    69             if (execution != null) {
    70               AtomicOperation op = new AtomicOperation(execution.Engine.OperatorGraph.InitialOperator, execution.Engine.GlobalScope);
    71               WaitHandle opWh = jobManager.BeginExecuteOperation(execution.Engine.GlobalScope, op);
     69            IAlgorithm algorithm = Dispatcher.GetNextJob();
     70            if (algorithm != null) {
     71              AtomicOperation op = new AtomicOperation(algorithm.Engine.OperatorGraph.InitialOperator, algorithm.Engine.GlobalScope);
     72              WaitHandle opWh = jobManager.BeginExecuteOperation(algorithm.Engine.GlobalScope, op);
    7273              wh.Add(opWh);
    7374              activeOperations.Add(opWh, op);
    74               lock (activeExecutions) {
    75                 activeExecutions.Add(opWh, execution);
     75              lock (activeAlgorithms) {
     76                activeAlgorithms.Add(opWh, algorithm);
    7677              }
    7778            }
     
    8485            AtomicOperation finishedOp = activeOperations[readyHandle];
    8586            wh.Remove(readyHandle);
    86             Execution finishedExecution = null;
    87             lock (activeExecutions) {
    88               finishedExecution = activeExecutions[readyHandle];
    89               activeExecutions.Remove(readyHandle);
     87            IAlgorithm finishedAlgorithm = null;
     88            lock (activeAlgorithms) {
     89              finishedAlgorithm = activeAlgorithms[readyHandle];
     90              activeAlgorithms.Remove(readyHandle);
    9091            }
    9192            activeOperations.Remove(readyHandle);
     
    99100            }
    100101            if (finishedEngine != null) {
    101               StoreResults(finishedExecution, finishedEngine);
     102              StoreResults(finishedAlgorithm);
    102103            }
    103104          }
     
    110111
    111112    public override string[] GetJobs() {
    112       lock (activeExecutions) {
    113         string[] retVal = new string[activeExecutions.Count];
     113      lock (activeAlgorithms) {
     114        string[] retVal = new string[activeAlgorithms.Count];
    114115        int i = 0;
    115         foreach (Execution e in activeExecutions.Values) {
    116           retVal[i++] = "Target-Variable: " + e.TargetVariable + " " + e.Description;
     116        foreach (IAlgorithm a in activeAlgorithms.Values) {
     117          retVal[i++] = "Target-Variable: " + a.TargetVariable + " " + a.Description;
    117118        }
    118119        return retVal;
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj

    r1898 r1922  
    9999    <Compile Include="GridExecuter.cs" />
    100100    <Compile Include="IDispatcher.cs" />
    101     <Compile Include="Execution.cs" />
    102101    <Compile Include="Server.cs" />
    103102    <Compile Include="ServerApplication.cs" />
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/HiveExecuter.cs

    r1898 r1922  
    3939using System.Threading;
    4040using HeuristicLab.Hive.Engine;
     41using HeuristicLab.Modeling;
    4142
    4243namespace HeuristicLab.CEDMA.Server {
    4344  public class HiveExecuter : ExecuterBase {
    44     private Dictionary<WaitHandle, Execution> activeExecutions;
     45    private Dictionary<WaitHandle, IAlgorithm> activeAlgorithms;
    4546    private Dictionary<WaitHandle, HiveEngine> activeEngines;
    4647    private string hiveUrl;
     
    5758      : base(dispatcher, store) {
    5859      this.hiveUrl = hiveUrl;
    59       activeExecutions = new Dictionary<WaitHandle, Execution>();
     60      activeAlgorithms = new Dictionary<WaitHandle, IAlgorithm>();
    6061      activeEngines = new Dictionary<WaitHandle, HiveEngine>();
    6162    }
     
    6869          while (wh.Count < MaxActiveJobs) {
    6970            Thread.Sleep(StartJobInterval);
    70             // get an execution from the dispatcher and execute in grid via job-manager
    71             Execution execution = Dispatcher.GetNextJob();
    72             if (execution != null) {
     71            // get an algo from the dispatcher and execute in grid via job-manager
     72            IAlgorithm algorithm = Dispatcher.GetNextJob();
     73            if (algorithm != null) {
    7374              HiveEngine engine = new HiveEngine();
    7475              engine.HiveServerUrl = hiveUrl;
    75               IOperator initialOp = execution.Engine.OperatorGraph.InitialOperator;
     76              IOperator initialOp = algorithm.Engine.OperatorGraph.InitialOperator;
    7677              engine.OperatorGraph.AddOperator(initialOp);
    7778              engine.OperatorGraph.InitialOperator = initialOp;
    78               RegisterFinishedCallback(engine, execution, wh);
     79              RegisterFinishedCallback(engine, algorithm, wh);
    7980              engine.Reset();
    8081              engine.Execute();
     
    9091            activeEngines.Remove(readyHandle);
    9192
    92             Execution finishedExecution = activeExecutions[readyHandle];
    93             lock (activeExecutions) {
    94               activeExecutions.Remove(readyHandle);
     93            IAlgorithm finishedAlgorithm = activeAlgorithms[readyHandle];
     94            lock (activeAlgorithms) {
     95              activeAlgorithms.Remove(readyHandle);
    9596            }
    96             StoreResults(finishedExecution, finishedEngine);
     97            StoreResults(finishedAlgorithm);
    9798            readyHandle.Close();
    9899          }
     
    104105    }
    105106
    106     private void RegisterFinishedCallback(HiveEngine engine, Execution execution, List<WaitHandle> wh) {
     107    private void RegisterFinishedCallback(HiveEngine engine, IAlgorithm algorithm, List<WaitHandle> wh) {
    107108      ManualResetEvent waithandle = new ManualResetEvent(false);
    108109      wh.Add(waithandle);
    109110      engine.Finished += (sender, args) => waithandle.Set();
    110       lock (activeExecutions) {
    111         activeExecutions.Add(waithandle, execution);
     111      lock (activeAlgorithms) {
     112        activeAlgorithms.Add(waithandle, algorithm);
    112113      }
    113114      activeEngines.Add(waithandle, engine);
     
    115116
    116117    public override string[] GetJobs() {
    117       lock (activeExecutions) {
    118         string[] retVal = new string[activeExecutions.Count];
     118      lock (activeAlgorithms) {
     119        string[] retVal = new string[activeAlgorithms.Count];
    119120        int i = 0;
    120         foreach (Execution e in activeExecutions.Values) {
    121           retVal[i++] = "Target-Variable: " + e.TargetVariable + " " + e.Description;
     121        foreach (IAlgorithm a in activeAlgorithms.Values) {
     122          retVal[i++] = "Target-Variable: " + a.TargetVariable + " " + a.Description;
    122123        }
    123124        return retVal;
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/IDispatcher.cs

    r1529 r1922  
    3535using HeuristicLab.Data;
    3636using HeuristicLab.Core;
     37using HeuristicLab.Modeling;
    3738
    3839namespace HeuristicLab.CEDMA.Server {
    3940  public interface IDispatcher {
    40     Execution GetNextJob();
     41    IAlgorithm GetNextJob();
    4142  }
    4243}
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs

    r1906 r1922  
    4242    public virtual string Description { get { return "TODO"; } }
    4343
     44    public abstract Dataset Dataset { get; set; }
     45    public abstract int TargetVariable { get; set; }
     46
    4447    public virtual double MutationRate {
    4548      get { return GetVariableInjector().GetVariable("MutationRate").GetValue<DoubleData>().Data; }
     
    457460    #endregion
    458461
     462
    459463  }
    460464}
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs

    r1908 r1922  
    4040
    4141    public override string Name { get { return "StandardGP"; } }
     42
     43    public override int TargetVariable {
     44      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
     45      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
     46    }
     47
     48    public override Dataset Dataset {
     49      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
     50      set { ProblemInjector.GetVariable("Dataset").Value = value; }
     51    }
    4252
    4353    public virtual int MaxGenerations {
     
    315325      Model model = base.CreateGPModel(bestModelScope);
    316326      model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
     327      model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
     328      model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
     329      model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
     330      model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
     331      model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
     332      model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
     333      model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
     334      model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
     335      model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
     336      model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
     337      model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
     338      model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
     339
    317340      return model;
    318341    }
  • trunk/sources/HeuristicLab.Modeling/3.2/IAlgorithm.cs

    r1906 r1922  
    2424using System.Text;
    2525using HeuristicLab.Core;
     26using HeuristicLab.DataAnalysis;
    2627
    2728namespace HeuristicLab.Modeling {
     
    3031    string Description { get; }
    3132    IOperator ProblemInjector { get; set; }
     33    Dataset Dataset { get; set; }
     34    int TargetVariable { get; set; }
    3235    IEngine Engine { get; }
    33 
    3436    IModel Model { get; }
    3537  }
  • trunk/sources/HeuristicLab.Modeling/3.2/IModel.cs

    r1906 r1922  
    3333    double ValidationMeanSquaredError { get; }
    3434    double TestMeanSquaredError { get; }
     35    double TrainingMeanAbsolutePercentageError { get; }
     36    double ValidationMeanAbsolutePercentageError { get; }
     37    double TestMeanAbsolutePercentageError { get; }
     38    double TrainingMeanAbsolutePercentageOfRangeError { get; }
     39    double ValidationMeanAbsolutePercentageOfRangeError { get; }
     40    double TestMeanAbsolutePercentageOfRangeError { get; }
     41    double TrainingCoefficientOfDetermination { get; }
     42    double ValidationCoefficientOfDetermination { get; }
     43    double TestCoefficientOfDetermination { get; }
     44    double TrainingVarianceAccountedFor { get; }
     45    double ValidationVarianceAccountedFor { get; }
     46    double TestVarianceAccountedFor { get; }
     47
    3548    IItem Data { get; }
    3649  }
  • trunk/sources/HeuristicLab.Modeling/3.2/Model.cs

    r1906 r1922  
    6060    }
    6161
     62    public double TrainingMeanAbsolutePercentageError {
     63      get;
     64      set;
     65    }
     66
     67    public double ValidationMeanAbsolutePercentageError {
     68      get;
     69      set;
     70    }
     71
     72    public double TestMeanAbsolutePercentageError {
     73      get;
     74      set;
     75    }
     76
     77    public double TrainingMeanAbsolutePercentageOfRangeError {
     78      get;
     79      set;
     80    }
     81
     82    public double ValidationMeanAbsolutePercentageOfRangeError {
     83      get;
     84      set;
     85    }
     86
     87    public double TestMeanAbsolutePercentageOfRangeError {
     88      get;
     89      set;
     90    }
     91
     92    public double TrainingCoefficientOfDetermination {
     93      get;
     94      set;
     95    }
     96
     97    public double ValidationCoefficientOfDetermination {
     98      get;
     99      set;
     100    }
     101
     102    public double TestCoefficientOfDetermination {
     103      get;
     104      set;
     105    }
     106
     107    public double TrainingVarianceAccountedFor {
     108      get;
     109      set;
     110    }
     111
     112    public double ValidationVarianceAccountedFor {
     113      get;
     114      set;
     115    }
     116
     117    public double TestVarianceAccountedFor {
     118      get;
     119      set;
     120    }
     121
    62122    private IItem data;
    63123    public IItem Data {
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r1906 r1922  
    4444    public IEngine Engine {
    4545      get { return engine; }
     46    }
     47
     48    public Dataset Dataset {
     49      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
     50      set { ProblemInjector.GetVariable("Dataset").Value = value; }
     51    }
     52
     53    public int TargetVariable {
     54      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
     55      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
    4656    }
    4757
     
    284294    protected internal virtual Model CreateSVMModel(IScope bestModelScope) {
    285295      Model model = new Model();
     296      model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data;
     297      model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
     298      model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
     299      model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
     300      model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
     301      model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
     302      model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
     303      model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
     304      model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
     305      model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
     306      model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
     307      model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
     308      model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
     309      model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
     310      model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
     311     
    286312      model.Data = bestModelScope.GetVariableValue<SVMModel>("BestValidationModel", false);
     313      HeuristicLab.DataAnalysis.Dataset ds = bestModelScope.GetVariableValue<Dataset>("Dataset", true);
     314      model.Dataset = ds;
     315      model.TargetVariable = ds.GetVariableName(bestModelScope.GetVariableValue<IntData>("TargetVariable", true).Data);
    287316      return model;
    288317    }
     
    308337
    309338    #endregion
     339
    310340  }
    311341}
Note: See TracChangeset for help on using the changeset viewer.