Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/13 16:54:01 (12 years ago)
Author:
sforsten
Message:

#1980:

  • renamed algorithm Learning Classifier System to XCS
  • DecisionListSolution and XCSSolution show more information
  • VariableVectorClassificationProblemData can now also import datasets where the last variable is not the target variable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Problems.VariableVectorClassification/3.3/VariableVectorClassificationProblemData.cs

    r9475 r9494  
    7474    public VariableVectorClassificationProblemData(Dataset dataset, IEnumerable<string> allowedConditionVariables, IEnumerable<string> allowedActionVariables) :
    7575      base(dataset, allowedConditionVariables, allowedActionVariables) {
    76       Parameters.Add(new ValueParameter<VariableVector>("SampleVariableVector", "", GenerateSampleVariableVector(dataset, allowedConditionVariables, allowedActionVariables)));
     76      Parameters.Add(new ValueParameter<VariableVector>("SampleVariableVector", "", GenerateSampleVariableVector(dataset, AllowedConditionVariables, AllowedActionVariables)));
    7777      Parameters.Add(new FixedValueParameter<PercentValue>("SpreadPercentage", "", new PercentValue(0.5)));
     78    }
     79
     80    protected override CheckedItemList<StringValue> CheckVariablesForPossibleTargetVariables(Dataset dataset) {
     81      var allVariables = GetVariablesOfDataSet(dataset, dataset.VariableNames).Where(v => v is StringVariable || v is IntVariable).Select(v => new StringValue(v.VariableName));
     82      return new CheckedItemList<StringValue>(allVariables);
    7883    }
    7984
     
    8186      var conditionVariables = GetVariablesOfDataSet(dataset, allowedConditionVariables);
    8287      var actionVariables = GetVariablesOfDataSet(dataset, allowedActionVariables);
    83       if (actionVariables.Count() == 0 || !actionVariables.All(x => x is IActionVariable)) {
     88      if (!actionVariables.All(x => x is IActionVariable)) {
    8489        throw new ArgumentException("Action variable can not be empty and all action variables have to be of type int or string.");
    8590      }
     
    8792    }
    8893
    89     private IEnumerable<Encodings.VariableVector.IVariable> GetVariablesOfDataSet(DataAnalysis.Dataset dataset, IEnumerable<string> allowedVariables) {
     94    private IEnumerable<Encodings.VariableVector.IVariable> GetVariablesOfDataSet(Dataset dataset, IEnumerable<string> allowedVariables) {
    9095      var variables = new List<HeuristicLab.Encodings.VariableVector.IVariable>();
    9196      foreach (var variableName in allowedVariables) {
Note: See TracChangeset for help on using the changeset viewer.