Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/16/09 09:42:50 (15 years ago)
Author:
gkronber
Message:

Improved schema for variable impacts. #644

Location:
trunk/sources/HeuristicLab.CEDMA.Server/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs

    r2012 r2047  
    4848    public IAlgorithm GetNextJob() {
    4949      if (dataset == null) {
    50         var datasetEntities = store.Query("?DataSet <" + Ontology.PredicateInstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .", 0, 1)
     50        var datasetEntities = store.Query("?DataSet <" + Ontology.InstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .", 0, 1)
    5151          .Select(x => (Entity)x.Get("DataSet"));
    5252        if (datasetEntities.Count() == 0) return null;
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs

    r2045 r2047  
    7171    protected void StoreResults(IAlgorithm finishedAlgorithm) {
    7272      Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    73       // store.Add(new Statement(finishedAlgorithm.DataSetEntity, Ontology.PredicateHasModel, modelEntity));
    74       StoreModelAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
    75       StoreModelAttribute(modelEntity, Ontology.AlgorithmName, finishedAlgorithm.Description);
     73      store.Add(new Statement(modelEntity, Ontology.InstanceOf, Ontology.TypeModel));
     74      StoreEntityAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
     75      StoreEntityAttribute(modelEntity, Ontology.AlgorithmName, finishedAlgorithm.Description);
    7676     
    7777      IModel model = finishedAlgorithm.Model;
    78       StoreModelAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);
    79       StoreModelAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);
    80       StoreModelAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);
    81       StoreModelAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);
    82       StoreModelAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);
    83       StoreModelAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);
    84       StoreModelAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);
    85       StoreModelAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);
    86       StoreModelAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);
    87       StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);
    88       StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);
    89       StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);
    90       StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);
    91       StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);
    92       StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
     78      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);
     79      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);
     80      StoreEntityAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);
     81      StoreEntityAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);
     82      StoreEntityAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);
     83      StoreEntityAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);
     84      StoreEntityAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);
     85      StoreEntityAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);
     86      StoreEntityAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);
     87      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);
     88      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);
     89      StoreEntityAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);
     90      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);
     91      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);
     92      StoreEntityAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
    9393
    9494      for (int i = 0; i < finishedAlgorithm.Dataset.Columns; i++) {
    9595        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)));
     96          string variableName = finishedAlgorithm.Dataset.GetVariableName(i);
     97          double qualImpact = model.GetVariableQualityImpact(variableName);
     98          double evalImpact = model.GetVariableEvaluationImpact(variableName);
     99
     100          Entity inputVariableEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
     101          store.Add(new Statement(inputVariableEntity, Ontology.InstanceOf, Ontology.TypeVariableImpact));
     102          store.Add(new Statement(modelEntity, Ontology.HasInputVariable, inputVariableEntity));
     103          StoreEntityAttribute(inputVariableEntity, Ontology.EvaluationImpact, evalImpact);
     104          StoreEntityAttribute(inputVariableEntity, Ontology.QualityImpact, qualImpact);
     105          StoreEntityAttribute(inputVariableEntity, Ontology.Name, variableName);
    100106        }
    101107        catch (ArgumentException) {
     
    105111
    106112      byte[] serializedModel = PersistenceManager.SaveToGZip(model.Data);
    107       store.Add(new Statement(modelEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
     113      store.Add(new Statement(modelEntity, Ontology.SerializedData, new Literal(Convert.ToBase64String(serializedModel))));
    108114    }
    109115
    110     private void StoreModelAttribute(Entity model, Entity predicate, object value) {
    111       store.Add(new Statement(model, predicate, new Literal(value)));
     116    private void StoreEntityAttribute(Entity entity, Entity predicate, object value) {
     117      store.Add(new Statement(entity, predicate, new Literal(value)));
    112118    }
    113119
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2012 r2047  
    100100      var datasetEntity = store
    101101        .Query(
    102         "?Dataset <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)
     102        "?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)
    103103        .Select(x => (Entity)x.Get("Dataset")).ElementAt(0);
    104104      DataSet ds = new DataSet(store, datasetEntity);
     
    107107        .Query(
    108108        "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." + Environment.NewLine +
    109         "?Model <" + Ontology.AlgorithmName + "> ?AlgoName .",
     109        "?Model <" + Ontology.Name + "> ?AlgoName .",
    110110        0, 1000)
    111111        .Select(x => new Resource[] { (Literal)x.Get("TargetVariable"), (Literal)x.Get("AlgoName") });
Note: See TracChangeset for help on using the changeset viewer.