Changeset 1869 for trunk/sources
- Timestamp:
- 05/20/09 12:52:52 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs
r1857 r1869 40 40 public abstract class DispatcherBase : IDispatcher { 41 41 private IStore store; 42 43 private static int MaxGenerations {44 get { return 3; }45 }46 47 private static int MaxEvaluatedSolutions {48 get { return 3000; }49 }50 51 42 public DispatcherBase(IStore store) { 52 43 this.store = store; … … 88 79 89 80 private Execution CreateExecution(Problem problem, int targetVariable, IAlgorithm algorithm) { 90 //switch (algorithm) {91 // case Algorithm.StandardGpRegression: {92 // var algo = new HeuristicLab.GP.StructureIdentification.StandardGP();93 // SetComplexityParameters(algo, complexity);94 // SetProblemParameters(algo, problem, targetVariable);95 // algo.PopulationSize = 10000;96 // algo.MaxGenerations = MaxGenerations;97 // Execution exec = new Execution(algo.Engine);98 // exec.Description = "StandardGP - Complexity: " + complexity;99 // return exec;100 // }101 81 SetProblemParameters(algorithm, problem, targetVariable); 102 82 Execution exec = new Execution(algorithm.Engine); -
trunk/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj
r1857 r1869 96 96 </Compile> 97 97 <Compile Include="Properties\AssemblyInfo.cs" /> 98 <Compile Include="SimpleMSEEvaluator.cs" /> 99 <Compile Include="SimpleR2Evaluator.cs" /> 98 100 <Compile Include="TimeSeriesProblemInjector.cs" /> 99 101 </ItemGroup> -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleMSEEvaluator.cs
r1854 r1869 7 7 using HeuristicLab.DataAnalysis; 8 8 9 namespace HeuristicLab. SupportVectorMachines{10 public class SimpleMSEEvaluator : OperatorBase {9 namespace HeuristicLab.Modeling { 10 public class SimpleMSEEvaluator : OperatorBase { 11 11 12 12 public SimpleMSEEvaluator() 13 13 : base() { 14 AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof( ItemList), VariableKind.In));14 AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof(DoubleMatrixData), VariableKind.In)); 15 15 AddVariableInfo(new VariableInfo("MSE", "Mean squarred error", typeof(DoubleData), VariableKind.New | VariableKind.Out)); 16 16 } 17 17 18 18 public override IOperation Apply(IScope scope) { 19 ItemList values = GetVariableValue<ItemList>("Values", scope, true);19 DoubleMatrixData values = GetVariableValue<DoubleMatrixData>("Values", scope, true); 20 20 double sse = 0; 21 double cnt = 0; 22 for each (ItemList row in values) {23 double estimated = ((DoubleData)row[0]).Data;24 double target = ((DoubleData)row[1]).Data;21 double cnt = 0; 22 for (int i = 0; i < values.Data.GetLength(0); i++) { 23 double estimated = values.Data[i, 0]; 24 double target = values.Data[i, 1]; 25 25 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && 26 26 !double.IsNaN(target) && !double.IsInfinity(target)) { … … 32 32 33 33 double mse = sse / cnt; 34 scope.AddVariable(new Variable(scope.TranslateName("MSE"), new DoubleData(mse)));34 scope.AddVariable(new Variable(scope.TranslateName("MSE"), new DoubleData(mse))); 35 35 return null; 36 36 } -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleR2Evaluator.cs
r1854 r1869 7 7 using HeuristicLab.DataAnalysis; 8 8 9 namespace HeuristicLab. SupportVectorMachines{10 public class SimpleR2Evaluator : OperatorBase {9 namespace HeuristicLab.Modeling { 10 public class SimpleR2Evaluator : OperatorBase { 11 11 12 12 public SimpleR2Evaluator() 13 13 : base() { 14 AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof( ItemList), VariableKind.In));14 AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof(DoubleMatrixData), VariableKind.In)); 15 15 AddVariableInfo(new VariableInfo("R2", "Coefficient of determination", typeof(DoubleData), VariableKind.New | VariableKind.Out)); 16 16 } 17 17 18 18 public override IOperation Apply(IScope scope) { 19 ItemList values = GetVariableValue<ItemList>("Values", scope, true);19 DoubleMatrixData values = GetVariableValue<DoubleMatrixData>("Values", scope, true); 20 20 21 21 double targetMean = 0; 22 22 double sse = 0; 23 23 double cnt = 0; 24 for each (ItemList row in values) {25 double estimated = ((DoubleData)row[0]).Data;26 double target = ((DoubleData)row[1]).Data;24 for (int i = 0; i < values.Data.GetLength(0); i++) { 25 double estimated = values.Data[i, 0]; 26 double target = values.Data[i, 1]; 27 27 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && 28 28 !double.IsNaN(target) && !double.IsInfinity(target)) { … … 36 36 37 37 double targetDeviationTotalSumOfSquares = 0; 38 for each (ItemList row in values) {39 double target = ((DoubleData)row[1]).Data;38 for (int i = 0; i < values.Data.GetLength(0); i++) { 39 double target = values.Data[i, 1]; 40 40 if (!double.IsNaN(target) && !double.IsInfinity(target)) { 41 41 target = target - targetMean; -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/HeuristicLab.SupportVectorMachines-3.2.csproj
r1857 r1869 86 86 <Compile Include="HeuristicLabSupportVectorMachinesPlugin.cs" /> 87 87 <Compile Include="Properties\AssemblyInfo.cs" /> 88 <Compile Include="SimpleMSEEvaluator.cs" />89 <Compile Include="SimpleR2Evaluator.cs" />90 88 <Compile Include="SupportVectorCreator.cs" /> 91 89 <Compile Include="SupportVectorEvaluator.cs" /> -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
r1858 r1869 146 146 solStorer.GetVariableInfo("Quality").ActualName = "ValidationMSE"; 147 147 solStorer.GetVariableInfo("Maximization").Local = true; 148 solStorer.GetVariableInfo("BestSolution").ActualName = "BestValidationSolution"; 148 149 solStorer.AddVariable(new HeuristicLab.Core.Variable("Maximization", new BoolData(false))); 149 150
Note: See TracChangeset
for help on using the changeset viewer.