Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/29/16 10:36:52 (8 years ago)
Author:
pfleck
Message:

#2597

  • Merged recent trunk changes.
  • Adapted VariablesUsedForPrediction property for RegressionSolutionTargetResponseGradientView.
  • Fixed a reference (.dll to project ref).
Location:
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis

  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneRClassificationModel.cs

    r13098 r13948  
    3131  [StorableClass]
    3232  [Item("OneR Classification Model", "A model that uses intervals for one variable to determine the class.")]
    33   public class OneRClassificationModel : NamedItem, IClassificationModel {
     33  public class OneRClassificationModel : ClassificationModel {
     34    public override IEnumerable<string> VariablesUsedForPrediction {
     35      get { return new[] { Variable }; }
     36    }
     37
    3438    [Storable]
    3539    protected string variable;
     
    6670    public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); }
    6771
    68     public OneRClassificationModel(string variable, double[] splits, double[] classes, double missingValuesClass = double.NaN)
    69       : base() {
     72    public OneRClassificationModel(string targetVariable, string variable, double[] splits, double[] classes, double missingValuesClass = double.NaN)
     73      : base(targetVariable) {
    7074      if (splits.Length != classes.Length) {
    7175        throw new ArgumentException("Number of splits and classes has to be equal.");
     
    8488    // uses sorting to return the values in the order of rows, instead of using nested for loops
    8589    // to avoid O(n²) runtime
    86     public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
     90    public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    8791      var values = dataset.GetDoubleValues(Variable, rows).ToArray();
    8892      var rowsArray = rows.ToArray();
     
    108112    }
    109113
    110     public IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     114    public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
    111115      return new OneRClassificationSolution(this, new ClassificationProblemData(problemData));
    112116    }
Note: See TracChangeset for help on using the changeset viewer.