Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/08 01:22:08 (15 years ago)
Author:
gkronber
Message:

worked on #419 (Refactor CEDMA plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/ResultList.cs

    r656 r988  
    5050
    5151  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);
    6752    private Dictionary<Record, Dataset> datasets;
    6853
     
    10186    }
    10287    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))
    10489      .Select(x => store.Select(new SelectFilter(
    10590        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 })));
    11093
    11194      Random random = new Random();
     
    143126      records = new List<Record>();
    144127      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;
    156139    }
    157140
     
    161144
    162145    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));
    164147      if(modelResults.Count == 1) {
    165148        string rawData = ((SerializedLiteral)modelResults[0].Property).RawData;
     
    177160    private Dataset GetDataset(Record record) {
    178161      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)));
    180163        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));
    182165          if(datasetResult.Count == 1) {
    183166            string rawData = ((SerializedLiteral)datasetResult[0].Property).RawData;
     
    193176
    194177    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));
    196179      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));
    198181        if(algoResult.Count == 1) {
    199182          string rawData = ((SerializedLiteral)algoResult[0].Property).RawData;
Note: See TracChangeset for help on using the changeset viewer.