Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14615


Ignore:
Timestamp:
01/27/17 16:01:28 (8 years ago)
Author:
mkommend
Message:

#2650: Minor changes in factors branch (sealed one factor classes).

Location:
branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneFactorClassificationModel.cs

    r14242 r14615  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Diagnostics.Eventing.Reader;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    3231  [StorableClass]
    3332  [Item("OneFactor Classification Model", "A model that uses only one categorical feature (factor) to determine the class.")]
    34   public class OneFactorClassificationModel : ClassificationModel {
     33  public sealed class OneFactorClassificationModel : ClassificationModel {
    3534    public override IEnumerable<string> VariablesUsedForPrediction {
    3635      get { return new[] { Variable }; }
     
    3837
    3938    [Storable]
    40     protected string variable;
     39    private string variable;
    4140    public string Variable {
    4241      get { return variable; }
     
    4443
    4544    [Storable]
    46     protected string[] variableValues;
     45    private string[] variableValues;
    4746    public string[] VariableValues {
    4847      get { return variableValues; }
     
    5049
    5150    [Storable]
    52     protected double[] classes;
     51    private double[] classes;
    5352    public double[] Classes {
    5453      get { return classes; }
     
    5655
    5756    [Storable]
    58     protected double defaultClass;
     57    private double defaultClass;
    5958    public double DefaultClass {
    6059      get { return defaultClass; }
     
    6261
    6362    [StorableConstructor]
    64     protected OneFactorClassificationModel(bool deserializing) : base(deserializing) { }
    65     protected OneFactorClassificationModel(OneFactorClassificationModel original, Cloner cloner)
     63    private OneFactorClassificationModel(bool deserializing) : base(deserializing) { }
     64    private OneFactorClassificationModel(OneFactorClassificationModel original, Cloner cloner)
    6665      : base(original, cloner) {
    6766      this.variable = (string)original.variable;
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneFactorClassificationSolution.cs

    r14242 r14615  
    2828  [StorableClass]
    2929  [Item(Name = "OneR Classification Solution", Description = "Represents a OneR classification solution which uses only a single factor for class prediction.")]
    30   public class OneFactorClassificationSolution : ClassificationSolution {
     30  public sealed class OneFactorClassificationSolution : ClassificationSolution {
    3131    public new OneFactorClassificationModel Model {
    3232      get { return (OneFactorClassificationModel)base.Model; }
     
    3535
    3636    [StorableConstructor]
    37     protected OneFactorClassificationSolution(bool deserializing) : base(deserializing) { }
    38     protected OneFactorClassificationSolution(OneFactorClassificationSolution original, Cloner cloner) : base(original, cloner) { }
     37    private OneFactorClassificationSolution(bool deserializing) : base(deserializing) { }
     38    private OneFactorClassificationSolution(OneFactorClassificationSolution original, Cloner cloner) : base(original, cloner) { }
    3939    public OneFactorClassificationSolution(OneFactorClassificationModel model, IClassificationProblemData problemData)
    4040      : base(model, problemData) {
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneRClassificationModel.cs

    r14242 r14615  
    3131  [StorableClass]
    3232  [Item("OneR Classification Model", "A model that uses intervals for one variable to determine the class.")]
    33   public class OneRClassificationModel : ClassificationModel {
     33  public sealed class OneRClassificationModel : ClassificationModel {
    3434    public override IEnumerable<string> VariablesUsedForPrediction {
    3535      get { return new[] { Variable }; }
     
    3737
    3838    [Storable]
    39     protected string variable;
     39    private string variable;
    4040    public string Variable {
    4141      get { return variable; }
     
    4343
    4444    [Storable]
    45     protected double[] splits;
     45    private double[] splits;
    4646    public double[] Splits {
    4747      get { return splits; }
     
    4949
    5050    [Storable]
    51     protected double[] classes;
     51    private double[] classes;
    5252    public double[] Classes {
    5353      get { return classes; }
     
    5555
    5656    [Storable]
    57     protected double missingValuesClass;
     57    private double missingValuesClass;
    5858    public double MissingValuesClass {
    5959      get { return missingValuesClass; }
     
    6161
    6262    [StorableConstructor]
    63     protected OneRClassificationModel(bool deserializing) : base(deserializing) { }
    64     protected OneRClassificationModel(OneRClassificationModel original, Cloner cloner)
     63    private OneRClassificationModel(bool deserializing) : base(deserializing) { }
     64    private OneRClassificationModel(OneRClassificationModel original, Cloner cloner)
    6565      : base(original, cloner) {
    6666      this.variable = (string)original.variable;
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneRClassificationSolution.cs

    r14185 r14615  
    2828  [StorableClass]
    2929  [Item(Name = "OneR Classification Solution", Description = "Represents a OneR classification solution which uses only a single feature with potentially multiple thresholds for class prediction.")]
    30   public class OneRClassificationSolution : ClassificationSolution {
     30  public sealed class OneRClassificationSolution : ClassificationSolution {
    3131    public new OneRClassificationModel Model {
    3232      get { return (OneRClassificationModel)base.Model; }
     
    3535
    3636    [StorableConstructor]
    37     protected OneRClassificationSolution(bool deserializing) : base(deserializing) { }
    38     protected OneRClassificationSolution(OneRClassificationSolution original, Cloner cloner) : base(original, cloner) { }
     37    private OneRClassificationSolution(bool deserializing) : base(deserializing) { }
     38    private OneRClassificationSolution(OneRClassificationSolution original, Cloner cloner) : base(original, cloner) { }
    3939    public OneRClassificationSolution(OneRClassificationModel model, IClassificationProblemData problemData)
    4040      : base(model, problemData) {
  • branches/symbreg-factors-2650/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/AlglibUtil.cs

    r14240 r14615  
    104104        var varName = kvp.Key;
    105105        var cats = kvp.Value;
    106         var catCount = cats.Count();
    107         if (catCount == 0) continue;
     106        if (!cats.Any()) continue;
    108107        foreach (var cat in cats) {
    109108          var values = dataset.GetStringValues(varName, rows);
Note: See TracChangeset for help on using the changeset viewer.