Changeset 2045


Ignore:
Timestamp:
06/15/09 17:30:45 (12 years ago)
Author:
gkronber
Message:

Added code to store variable quality impacts for each model into the CEDMA result DB. #644

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/3.3/Ontology.cs

    r1890 r2045  
    100100    public static Entity TypeModel {
    101101      get { return new Entity(CedmaNameSpace + "Model"); }
     102    }
     103    public static Entity TypeVariableImpact {
     104      get { return new Entity(CedmaNameSpace + "VariableQualityImpact"); }
    102105    }
    103106    #endregion
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs

    r2000 r2045  
    9292      StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
    9393
     94      for (int i = 0; i < finishedAlgorithm.Dataset.Columns; i++) {
     95        try {
     96          double qualImpact = model.GetVariableQualityImpact(finishedAlgorithm.Dataset.GetVariableName(i));
     97          Entity impactEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
     98          store.Add(new Statement(impactEntity, Ontology.PredicateInstanceOf, Ontology.TypeVariableQualityImpact));
     99          store.Add(new Statement(modelEntity, impactEntity, new Literal(qualImpact)));
     100        }
     101        catch (ArgumentException) {
     102          // ignore
     103        }
     104      }
     105
    94106      byte[] serializedModel = PersistenceManager.SaveToGZip(model.Data);
    95107      store.Add(new Statement(modelEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
  • trunk/sources/HeuristicLab.Modeling/3.2/Model.cs

    r2041 r2045  
    122122    public double GetVariableQualityImpact(string variableName) {
    123123      if (variableQualityImpacts.ContainsKey(variableName)) return variableQualityImpacts[variableName];
    124       else return 1.0;
     124      else throw new ArgumentException("Impact of variable "+variableName+" is not available.");
    125125    }
    126126
    127127    public double GetVariableEvaluationImpact(string variableName) {
    128128      if (variableEvaluationImpacts.ContainsKey(variableName)) return variableEvaluationImpacts[variableName];
    129       else return 0.0;
     129      else throw new ArgumentException("Impact of variable " + variableName + " is not available.");
    130130    }
    131131
Note: See TracChangeset for help on using the changeset viewer.