Changeset 2047 for trunk/sources/HeuristicLab.CEDMA.Server/3.3
- Timestamp:
- 06/16/09 09:42:50 (15 years ago)
- 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 48 48 public IAlgorithm GetNextJob() { 49 49 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) 51 51 .Select(x => (Entity)x.Get("DataSet")); 52 52 if (datasetEntities.Count() == 0) return null; -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs
r2045 r2047 71 71 protected void StoreResults(IAlgorithm finishedAlgorithm) { 72 72 Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid()); 73 // store.Add(new Statement(finishedAlgorithm.DataSetEntity, Ontology.PredicateHasModel, modelEntity));74 Store ModelAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);75 Store ModelAttribute(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); 76 76 77 77 IModel model = finishedAlgorithm.Model; 78 Store ModelAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);79 Store ModelAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);80 Store ModelAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);81 Store ModelAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);82 Store ModelAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);83 Store ModelAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);84 Store ModelAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);85 Store ModelAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);86 Store ModelAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);87 Store ModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);88 Store ModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);89 Store ModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);90 Store ModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);91 Store ModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);92 Store ModelAttribute(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); 93 93 94 94 for (int i = 0; i < finishedAlgorithm.Dataset.Columns; i++) { 95 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))); 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); 100 106 } 101 107 catch (ArgumentException) { … … 105 111 106 112 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)))); 108 114 } 109 115 110 private void Store ModelAttribute(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))); 112 118 } 113 119 -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs
r2012 r2047 100 100 var datasetEntity = store 101 101 .Query( 102 "?Dataset <" + Ontology. PredicateInstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)102 "?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1) 103 103 .Select(x => (Entity)x.Get("Dataset")).ElementAt(0); 104 104 DataSet ds = new DataSet(store, datasetEntity); … … 107 107 .Query( 108 108 "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." + Environment.NewLine + 109 "?Model <" + Ontology. AlgorithmName + "> ?AlgoName .",109 "?Model <" + Ontology.Name + "> ?AlgoName .", 110 110 0, 1000) 111 111 .Select(x => new Resource[] { (Literal)x.Get("TargetVariable"), (Literal)x.Get("AlgoName") });
Note: See TracChangeset
for help on using the changeset viewer.