Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/27/09 13:22:41 (15 years ago)
Author:
gkronber
Message:

Added interface IModel and a standard implementation and changed SVM models to include the range transform in the model. #650 (IAlgorithm and derived interfaces should provide properties to retrieve results)

File:
1 edited

Legend:

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

    r1889 r1906  
    5858    }
    5959
     60    public IModel Model {
     61      get {
     62        if (!engine.Terminated) throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
     63        IScope bestModelScope = engine.GlobalScope.GetVariableValue<IScope>("BestValidationSolution", false);
     64        return CreateSVMModel(bestModelScope);
     65      }
     66    }
     67
    6068    public DoubleArrayData NuList {
    6169      get { return GetVariableInjector().GetVariable("NuList").GetValue<DoubleArrayData>(); }
     
    127135      modelCreator.GetVariableInfo("SVMModel").ActualName = "Model";
    128136      modelCreator.GetVariableInfo("SVMNu").ActualName = "Nu";
    129       modelCreator.GetVariableInfo("SVMRangeTransform").ActualName = "RangeTransform";
    130137      modelCreator.GetVariableInfo("SVMType").ActualName = "Type";
    131 
    132138
    133139      modelProcessor.AddSubOperator(modelCreator);
     
    196202      evaluator.Name = p + "SimpleEvaluator";
    197203      evaluator.GetVariableInfo("SVMModel").ActualName = "Model";
    198       evaluator.GetVariableInfo("SVMRangeTransform").ActualName = "RangeTransform";
    199204      evaluator.GetVariableInfo("SamplesStart").ActualName = p + "SamplesStart";
    200205      evaluator.GetVariableInfo("SamplesEnd").ActualName = p + "SamplesEnd";
     
    277282    }
    278283
     284    protected internal virtual Model CreateSVMModel(IScope bestModelScope) {
     285      Model model = new Model();
     286      model.Data = bestModelScope.GetVariableValue<SVMModel>("BestValidationModel", false);
     287      return model;
     288    }
     289
    279290    private IOperator GetVariableInjector() {
    280291      return GetMainOperator().SubOperators[0];
Note: See TracChangeset for help on using the changeset viewer.