Changeset 15484 for branches/Weighted TSNE
- Timestamp:
- 11/22/17 08:15:27 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Weighted TSNE/3.4/TSNE/TSNEAlgorithm.cs
r15479 r15484 285 285 var allowedInputVariables = problemData.AllowedInputVariables.ToArray(); 286 286 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(); 288 299 if (Normalization) data = NormalizeInputData(data); 289 300 state = TSNEStatic<double[]>.CreateState(data, DistanceFunction, random, NewDimensions, Perplexity, Theta, StopLyingIteration, MomentumSwitchIteration, InitialMomentum, FinalMomentum, Eta, RandomInitialization); … … 333 344 foreach (var input in Problem.ProblemData.InputVariables) ClassesNameParameter.ValidValues.Add(input); 334 345 } 346 335 347 private void OnColumnsChanged(object sender, EventArgs e) { 336 348 if (Problem == null || Problem.ProblemData == null || Problem.ProblemData.Dataset == null || !Parameters.ContainsKey(DistanceFunctionParameterName)) return;
Note: See TracChangeset
for help on using the changeset viewer.