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).

Location:
trunk/sources/HeuristicLab.SupportVectorMachines/3.2
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/HeuristicLab.SupportVectorMachines-3.2.csproj

    r2156 r2285  
    8383  </ItemGroup>
    8484  <ItemGroup>
     85    <Compile Include="Predictor.cs" />
    8586    <Compile Include="SupportVectorRegression.cs" />
    8687    <Compile Include="SVMModel.cs" />
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMHelper.cs

    r2165 r2285  
    3737            double value = dataset.GetValue(start + row, col);
    3838            if (!double.IsNaN(value))
    39               tempRow.Add(new SVM.Node(col, value));
     39              tempRow.Add(new SVM.Node(col + 1, value));
    4040          }
    4141        }
  • 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.