- Timestamp:
- 12/15/08 01:22:08 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/ResultList.cs
r656 r988 50 50 51 51 public class ResultList : ItemBase { 52 private const string cedmaNS = "http://www.heuristiclab.com/cedma/";53 private readonly Entity targetVariablePredicate = new Entity(cedmaNS + "TargetVariable");54 private readonly Entity trainingMAPEPredicate = new Entity(cedmaNS + "MeanAbsolutePercentageErrorTraining");55 private readonly Entity validationMAPEPredicate = new Entity(cedmaNS + "MeanAbsolutePercentageErrorValidation");56 private readonly Entity testMAPEPredicate = new Entity(cedmaNS + "MeanAbsolutePercentageErrorTest");57 private readonly Entity trainingR2Predicate = new Entity(cedmaNS + "CoefficientOfDeterminationTraining");58 private readonly Entity validationR2Predicate = new Entity(cedmaNS + "CoefficientOfDeterminationValidation");59 private readonly Entity testR2Predicate = new Entity(cedmaNS + "CoefficientOfDeterminationTest");60 private readonly Entity treeSizePredicate = new Entity(cedmaNS + "TreeSize");61 private readonly Entity treeHeightPredicate = new Entity(cedmaNS + "TreeHeight");62 private readonly Entity selectionPressurePredicate = new Entity(cedmaNS + "SelectionPressure");63 private readonly Entity rawDataPredicate = new Entity(cedmaNS + "RawData");64 private readonly Entity hasModelPredicate = new Entity(cedmaNS + "Model");65 private readonly Entity generatedByPredicate = new Entity(cedmaNS + "GeneratedBy");66 private readonly Entity anyEntity = new Entity(null);67 52 private Dictionary<Record, Dataset> datasets; 68 53 … … 101 86 } 102 87 private void ReloadList() { 103 var results = store.Select(new Statement( anyEntity, new Entity(cedmaNS + "instanceOf"), new Literal("class:GpFunctionTree")))88 var results = store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateInstanceOf, Ontology.TypeGeneticProgrammingFunctionTree)) 104 89 .Select(x => store.Select(new SelectFilter( 105 90 new Entity[] { new Entity(x.Subject.Uri) }, 106 new Entity[] { targetVariablePredicate, treeSizePredicate, treeHeightPredicate, selectionPressurePredicate, 107 trainingMAPEPredicate, validationMAPEPredicate, testMAPEPredicate, 108 trainingR2Predicate, validationR2Predicate, testR2Predicate }, 109 new Resource[] { anyEntity }))); 91 new Entity[] { Ontology.PredicateModelAttribute }, 92 new Resource[] { Ontology.AnyEntity }))); 110 93 111 94 Random random = new Random(); … … 143 126 records = new List<Record>(); 144 127 datasets = new Dictionary<Record, Dataset>(); 145 predicateToVariableName = new Dictionary<Entity, string>();146 predicateToVariableName[targetVariablePredicate] = Record.TARGET_VARIABLE;147 predicateToVariableName[treeSizePredicate] = Record.TREE_SIZE;148 predicateToVariableName[treeHeightPredicate] = Record.TREE_HEIGHT;149 predicateToVariableName[selectionPressurePredicate] = Record.SELECTIONPRESSURE;150 predicateToVariableName[trainingMAPEPredicate] = Record.MAPE_TRAINING;151 predicateToVariableName[validationMAPEPredicate] = Record.MAPE_VALIDATION;152 predicateToVariableName[testMAPEPredicate] = Record.MAPE_TEST;153 predicateToVariableName[trainingR2Predicate] = Record.R2_TRAINING;154 predicateToVariableName[validationR2Predicate] = Record.R2_VALIDATION;155 predicateToVariableName[testR2Predicate] = Record.R2_TEST;128 //predicateToVariableName = new Dictionary<Entity, string>(); 129 //predicateToVariableName[targetVariablePredicate] = Record.TARGET_VARIABLE; 130 //predicateToVariableName[treeSizePredicate] = Record.TREE_SIZE; 131 //predicateToVariableName[treeHeightPredicate] = Record.TREE_HEIGHT; 132 //predicateToVariableName[selectionPressurePredicate] = Record.SELECTIONPRESSURE; 133 //predicateToVariableName[trainingMAPEPredicate] = Record.MAPE_TRAINING; 134 //predicateToVariableName[validationMAPEPredicate] = Record.MAPE_VALIDATION; 135 //predicateToVariableName[testMAPEPredicate] = Record.MAPE_TEST; 136 //predicateToVariableName[trainingR2Predicate] = Record.R2_TRAINING; 137 //predicateToVariableName[validationR2Predicate] = Record.R2_VALIDATION; 138 //predicateToVariableName[testR2Predicate] = Record.R2_TEST; 156 139 } 157 140 … … 161 144 162 145 internal void OpenModel(Record record) { 163 IList<Statement> modelResults = store.Select(new Statement(new Entity(record.Uri), rawDataPredicate, anyEntity));146 IList<Statement> modelResults = store.Select(new Statement(new Entity(record.Uri), Ontology.PredicateSerializedData, Ontology.AnyEntity)); 164 147 if(modelResults.Count == 1) { 165 148 string rawData = ((SerializedLiteral)modelResults[0].Property).RawData; … … 177 160 private Dataset GetDataset(Record record) { 178 161 if(!datasets.ContainsKey(record)) { 179 IList<Statement> result = store.Select(new Statement( anyEntity, hasModelPredicate, new Entity(record.Uri)));162 IList<Statement> result = store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateHasModel, new Entity(record.Uri))); 180 163 if(result.Count == 1) { 181 IList<Statement> datasetResult = store.Select(new Statement(result[0].Subject, rawDataPredicate, anyEntity));164 IList<Statement> datasetResult = store.Select(new Statement(result[0].Subject, Ontology.PredicateSerializedData, Ontology.AnyEntity)); 182 165 if(datasetResult.Count == 1) { 183 166 string rawData = ((SerializedLiteral)datasetResult[0].Property).RawData; … … 193 176 194 177 internal void OpenAlgorithm(Record record) { 195 IList<Statement> generatedBy = store.Select(new Statement(new Entity(record.Uri), generatedByPredicate, anyEntity));178 IList<Statement> generatedBy = store.Select(new Statement(new Entity(record.Uri), Ontology.PredicateGeneratedBy, Ontology.AnyEntity)); 196 179 if(generatedBy.Count == 1) { 197 IList<Statement> algoResult = store.Select(new Statement((Entity)generatedBy[0].Property, rawDataPredicate, anyEntity));180 IList<Statement> algoResult = store.Select(new Statement((Entity)generatedBy[0].Property, Ontology.PredicateSerializedData, Ontology.AnyEntity)); 198 181 if(algoResult.Count == 1) { 199 182 string rawData = ((SerializedLiteral)algoResult[0].Property).RawData;
Note: See TracChangeset
for help on using the changeset viewer.