Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/07/09 16:50:07 (15 years ago)
Author:
gkronber
Message:
  • Reimplemented method to read a list of already executed algorithms and configurations from the results DB
  • Fixed a bug in the GridExecuter
  • Added a button in the dispatcher view to speed up configuration of input variables

#712

File:
1 edited

Legend:

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

    r2223 r2258  
    6060        case LearningTask.Regression: {
    6161            var regressionAlgos = algos.Where(a => (a as IClassificationAlgorithm) == null && (a as ITimeSeriesAlgorithm) == null);
    62             selectedAlgorithm = ChooseDeterministic(targetVariable, inputVariables, regressionAlgos) ?? ChooseStochastic(regressionAlgos);
     62            selectedAlgorithm = ChooseDeterministic(targetVariable, inputVariables, regressionAlgos); // ?? ChooseStochastic(regressionAlgos);
    6363            break;
    6464          }
     
    9999
    100100    private void PopulateFinishedRuns() {
    101       //Dictionary<Entity, Entity> processedModels = new Dictionary<Entity, Entity>();
    102       //var datasetBindings = store
    103       //  .Query(
    104       //  "?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)
    105       //  .Select(x => (Entity)x.Get("Dataset"));
    106 
    107       //if (datasetBindings.Count() > 0) {
    108       //  var datasetEntity = datasetBindings.ElementAt(0);
    109 
    110       //  DataSet ds = new DataSet(store, datasetEntity);
    111       //  var result = store
    112       //    .Query(
    113       //    "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." + Environment.NewLine +
    114       //    "?Model <" + Ontology.Name + "> ?AlgoName .",
    115       //    0, 1000)
    116       //    .Select(x => new Resource[] { (Literal)x.Get("TargetVariable"), (Literal)x.Get("AlgoName"), (Entity)x.Get("Model") });
    117 
    118       //  foreach (Resource[] row in result) {
    119       //    Entity model = ((Entity)row[2]);
    120       //    if (!processedModels.ContainsKey(model)) {
    121       //      processedModels.Add(model, model);
    122 
    123       //      string targetVariable = (string)((Literal)row[0]).Value;
    124       //      string algoName = (string)((Literal)row[1]).Value;
    125       //      int targetVariableIndex = ds.Problem.Dataset.GetVariableIndex(targetVariable);
    126 
    127       //      var inputVariableLiterals = store
    128       //        .Query(
    129       //          "<" + model.Uri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." + Environment.NewLine +
    130       //          "?InputVariable <" + Ontology.Name + "> ?Name .",
    131       //          0, 1000)
    132       //        .Select(x => (Literal)x.Get("Name"))
    133       //        .Select(l => (string)l.Value)
    134       //        .Distinct();
    135 
    136       //      List<int> inputVariables = new List<int>();
    137       //      foreach (string variableName in inputVariableLiterals) {
    138       //        int variableIndex = ds.Problem.Dataset.GetVariableIndex(variableName);
    139       //        inputVariables.Add(variableIndex);
    140       //      }
    141       //      if (!AlgorithmFinishedOrDispatched(targetVariableIndex, inputVariables.ToArray(), algoName)) {
    142       //        AddDispatchedRun(targetVariableIndex, inputVariables.ToArray(), algoName);
    143       //      }
    144       //    }
    145       //  }
    146       //}
     101      var dispatchedAlgos = from model in Database.GetAllModels()
     102                            select new {
     103                              TargetVariable = model.TargetVariable.Name,
     104                              Algorithm = model.Algorithm.Name,
     105                              Inputvariables = Database.GetInputVariableResults(model).Select(x => x.Variable.Name).Distinct() };
     106      foreach (var algo in dispatchedAlgos) {
     107        AddDispatchedRun(algo.TargetVariable, algo.Inputvariables, algo.Algorithm);
     108      }
    147109    }
    148110
     
    180142    }
    181143
     144    private void AddDispatchedRun(string targetVariable, IEnumerable<string> inputVariables, string algorithm) {
     145      AddDispatchedRun(
     146        Problem.Dataset.GetVariableIndex(targetVariable),
     147        inputVariables.Select(x => Problem.Dataset.GetVariableIndex(x)).ToArray(),
     148        algorithm);
     149    }
     150
    182151    private void AddDispatchedRun(int targetVariable, int[] inputVariables, string algoName) {
    183152      if (!finishedAndDispatchedRuns.ContainsKey(targetVariable)) {
Note: See TracChangeset for help on using the changeset viewer.