Changeset 15484


Ignore:
Timestamp:
11/22/17 08:15:27 (4 years ago)
Author:
bwerth
Message:

#2850 changed data extraction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Weighted TSNE/3.4/TSNE/TSNEAlgorithm.cs

    r15479 r15484  
    285285        var allowedInputVariables = problemData.AllowedInputVariables.ToArray();
    286286        var allindices = Problem.ProblemData.AllIndices.ToArray();
    287         var data = allindices.Select(row => allowedInputVariables.Select(col => dataset.GetDoubleValue(col, row)).ToArray()).ToArray();
     287        var data = Enumerable.Range(0, dataset.Rows).Select(x => new double[allowedInputVariables.Length]).ToArray();
     288        var col = 0;
     289        foreach (var s in allowedInputVariables) {
     290          var row = 0;
     291          foreach (var d in dataset.GetDoubleValues(s)) {
     292            data[row][col] = d;
     293            row++;
     294          }
     295          col++;
     296        }
     297
     298        //data = allindices.Select(row => allowedInputVariables.Select(col => dataset.GetDoubleValue(col, row)).ToArray()).ToArray();
    288299        if (Normalization) data = NormalizeInputData(data);
    289300        state = TSNEStatic<double[]>.CreateState(data, DistanceFunction, random, NewDimensions, Perplexity, Theta, StopLyingIteration, MomentumSwitchIteration, InitialMomentum, FinalMomentum, Eta, RandomInitialization);
     
    333344      foreach (var input in Problem.ProblemData.InputVariables) ClassesNameParameter.ValidValues.Add(input);
    334345    }
     346
    335347    private void OnColumnsChanged(object sender, EventArgs e) {
    336348      if (Problem == null || Problem.ProblemData == null || Problem.ProblemData.Dataset == null || !Parameters.ContainsKey(DistanceFunctionParameterName)) return;
Note: See TracChangeset for help on using the changeset viewer.