Changeset 17851
- Timestamp:
- 02/26/21 09:51:21 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3106_AnalyticContinuedFractionsRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/ContinuedFractionRegression/Problem.cs
r17850 r17851 14 14 using HeuristicLab.Problems.DataAnalysis; 15 15 using HeuristicLab.Problems.DataAnalysis.Symbolic; 16 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 16 17 using HeuristicLab.Problems.Instances; 17 18 … … 417 418 #endregion 418 419 419 results.AddOrUpdateResult("Model", CreateSymbolicExpressionTree(binar, coeff, TrainingTrainingDataset.VariableNames.ToArray())); 420 #region create tree and regression solution 421 var allVariables = TrainingTrainingDataset.VariableNames; 422 var allowedInputVariables = allVariables.Take(allVariables.Count() - 1); 423 var targetVariable = allVariables.Last(); 424 425 var tree = CreateSymbolicExpressionTree(binar, coeff, TrainingTrainingDataset.VariableNames.ToArray()); 426 var model = new SymbolicRegressionModel(targetVariable, tree, new SymbolicDataAnalysisExpressionTreeLinearInterpreter()); 427 var combinedData = MatrixExtensions.VertCat(dataMatrix.CloneAsMatrix(), dataMatrixTest.CloneAsMatrix()); 428 var combinedDs = new Dataset(allVariables, combinedData); 429 var problemData = new RegressionProblemData(combinedDs, allowedInputVariables, targetVariable); 430 problemData.TrainingPartition.Start = 0; 431 problemData.TrainingPartition.End = dataMatrix.Rows; 432 problemData.TestPartition.Start = dataMatrix.Rows; 433 problemData.TestPartition.End = combinedDs.Rows; 434 var sol = new SymbolicRegressionSolution(model, problemData); 435 results.AddOrUpdateResult("Solution", sol); 436 #endregion 420 437 } 421 438 … … 457 474 458 475 var startNode = startSy.CreateTreeNode(); 459 var progRoot Node= progRootSy.CreateTreeNode();460 startNode.AddSubtree(progRootNode);461 progRootNode.AddSubtree(expression);462 return new SymbolicExpressionTree(progRoot Node) ;476 var progRoot = progRootSy.CreateTreeNode(); 477 progRoot.AddSubtree(startNode); 478 startNode.AddSubtree(expression); 479 return new SymbolicExpressionTree(progRoot) ; 463 480 } 464 481
Note: See TracChangeset
for help on using the changeset viewer.