Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/16 19:56:11 (8 years ago)
Author:
bburlacu
Message:

#2604: Revert changes to DataAnalysisSolution and IDataAnalysisSolution and implement the desired properties in model classes that implement IDataAnalysisModel, IRegressionModel and IClassificationModel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs

    r12509 r13921  
    4545    }
    4646
     47    public IEnumerable<string> VariablesUsedForPrediction {
     48      get { return originalTrainingData.AllowedInputVariables; }
     49    }
     50
     51    public string TargetVariable {
     52      get {
     53        var regressionProblemData = originalTrainingData as IRegressionProblemData;
     54        var classificationProblemData = originalTrainingData as IClassificationProblemData;
     55        if (classificationProblemData != null)
     56          return classificationProblemData.TargetVariable;
     57        if (regressionProblemData != null)
     58          return regressionProblemData.TargetVariable;
     59        throw new InvalidOperationException("Getting the target variable requires either a regression or a classification problem data.");
     60      }
     61    }
     62
    4763    // instead of storing the data of the model itself
    4864    // we instead only store data necessary to recalculate the same model lazily on demand
Note: See TracChangeset for help on using the changeset viewer.