Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/16 14:37:15 (8 years ago)
Author:
mkommend
Message:

#2604: Merged r13826,r13921, r13922, r13941, r13992, r13993, r14000 intos table.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneRClassificationModel.cs

    r13098 r14027  
    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.