Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/13/09 17:28:07 (15 years ago)
Author:
gkronber
Message:

Worked on #722 (IModel should provide a Predict() method to get predicted values for an input vector).
At the same time removed parameter PunishmentFactor from GP algorithms (this parameter is internal to TreeEvaluators now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r2270 r2285  
    6969    }
    7070
    71     public IModel Model {
     71    public IAnalyzerModel Model {
    7272      get {
    7373        if (!engine.Terminated) throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
     
    421421
    422422
    423     protected internal virtual Model CreateSVMModel(IScope bestModelScope) {
    424       Model model = new Model();
     423    protected internal virtual IAnalyzerModel CreateSVMModel(IScope bestModelScope) {
     424      AnalyzerModel model = new AnalyzerModel();
    425425      model.TrainingMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data;
    426426      model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
     
    439439      model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
    440440
    441       model.Data = bestModelScope.GetVariableValue<SVMModel>("Model", false);
    442441      HeuristicLab.DataAnalysis.Dataset ds = bestModelScope.GetVariableValue<Dataset>("Dataset", true);
    443442      model.Dataset = ds;
     
    449448      model.TestSamplesStart = bestModelScope.GetVariableValue<IntData>("TestSamplesStart", true).Data;
    450449      model.TestSamplesEnd = bestModelScope.GetVariableValue<IntData>("TestSamplesEnd", true).Data;
     450      model.Predictor = new Predictor(bestModelScope.GetVariableValue<SVMModel>("Model", false), model.TargetVariable);
     451
    451452
    452453      ItemList evaluationImpacts = bestModelScope.GetVariableValue<ItemList>("VariableEvaluationImpacts", false);
     
    456457        double impact = ((DoubleData)row[1]).Data;
    457458        model.SetVariableEvaluationImpact(variableName, impact);
    458         model.AddInputVariables(variableName);
     459        model.AddInputVariable(variableName);
    459460      }
    460461      foreach (ItemList row in qualityImpacts) {
     
    462463        double impact = ((DoubleData)row[1]).Data;
    463464        model.SetVariableQualityImpact(variableName, impact);
    464         model.AddInputVariables(variableName);
     465        model.AddInputVariable(variableName);
    465466      }
    466467
Note: See TracChangeset for help on using the changeset viewer.