- Timestamp:
- 09/16/09 13:13:52 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs
r2290 r2363 193 193 allowedFeatures.Add(new IntData(targetVariable)); 194 194 } 195 } else if (problem.LearningTask == LearningTask.Classification) { 196 ItemList<DoubleData> classValues = algo.ProblemInjector.GetVariable("TargetClassValues").GetValue<ItemList<DoubleData>>(); 197 foreach (double classValue in GetDifferentClassValues(problem.Dataset, targetVariable)) classValues.Add(new DoubleData(classValue)); 198 } 199 } 200 201 private IEnumerable<double> GetDifferentClassValues(HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable) { 202 return Enumerable.Range(0, dataset.Rows).Select(x => dataset.GetValue(x, targetVariable)).Distinct(); 203 } 195 } 196 } 197 204 198 205 199 private void AddDispatchedRun(string targetVariable, IEnumerable<string> inputVariables, string algorithm) { -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGPClassification.cs
r2361 r2363 42 42 } 43 43 44 protected virtualIAnalyzerModel CreateGPModel() {44 protected override IAnalyzerModel CreateGPModel() { 45 45 IScope bestModelScope = Engine.GlobalScope.SubScopes[0]; 46 46 var model = new AnalyzerModel(); -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/DefaultStructureIdentificationOperators.cs
r2362 r2363 156 156 157 157 public static void PopulateAnalyzerModel(IScope bestModelScope, IAnalyzerModel model) { 158 model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue< DoubleData>("EvaluatedSolutions", false).Data);158 model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue<IntData>("EvaluatedSolutions", false).Data); 159 159 IGeneticProgrammingModel gpModel = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("FunctionTree", false); 160 160 model.SetMetaData("TreeSize", gpModel.Size); -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs
r2362 r2363 34 34 35 35 namespace HeuristicLab.GP.StructureIdentification { 36 public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, I Algorithm {36 public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IStochasticAlgorithm { 37 37 public override string Name { get { return "OffspringSelectionGP - StructureIdentification"; } } 38 38 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs
r2362 r2363 33 33 34 34 namespace HeuristicLab.GP.StructureIdentification { 35 public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, I Algorithm {35 public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, IStochasticAlgorithm { 36 36 37 37 public override string Name { get { return "StandardGP - StructureIdentification"; } } … … 96 96 97 97 protected override IOperator CreateGenerationStepHook() { 98 return DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 98 IOperator op = DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 99 op.AddSubOperator(CreateBestSolutionProcessor()); 100 return op; 99 101 } 102 103 private IOperator CreateBestSolutionProcessor() { 104 CombinedOperator op = new CombinedOperator(); 105 op.Name = "BestSolutionProcessor"; 106 SequentialProcessor seq = new SequentialProcessor(); 107 108 ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator(); 109 evaluatedSolutionsStorer.RemoveVariableInfo("Result"); 110 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In)); 111 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New)); 112 evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions"; 113 evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions"; 114 evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;"; 115 116 seq.AddSubOperator(evaluatedSolutionsStorer); 117 118 op.OperatorGraph.AddOperator(seq); 119 op.OperatorGraph.InitialOperator = seq; 120 return op; 121 } 122 100 123 101 124 protected override VariableInjector CreateGlobalInjector() { … … 150 173 } 151 174 152 private IOperator CreateBestSolutionProcessor() {153 CombinedOperator op = new CombinedOperator();154 op.Name = "BestSolutionProcessor";155 SequentialProcessor seq = new SequentialProcessor();156 157 ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator();158 evaluatedSolutionsStorer.RemoveVariableInfo("Result");159 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In));160 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New));161 evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions";162 evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions";163 evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;";164 165 seq.AddSubOperator(evaluatedSolutionsStorer);166 167 op.OperatorGraph.AddOperator(seq);168 op.OperatorGraph.InitialOperator = seq;169 return op;170 }171 172 173 175 protected virtual IOperator CreateModelAnalyzerOperator() { 174 176 return DefaultRegressionOperators.CreatePostProcessingOperator(); -
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearClassification.cs
r2356 r2363 54 54 } 55 55 56 protected internal virtualIAnalyzerModel CreateLRModel(IScope bestModelScope) {56 protected override IAnalyzerModel CreateLRModel(IScope bestModelScope) { 57 57 var model = new AnalyzerModel(); 58 58 DefaultClassificationOperators.PopulateAnalyzerModel(bestModelScope, model); -
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs
r2360 r2363 60 60 get { 61 61 IOperator main = GetMainOperator(); 62 return main.SubOperators[2]; 62 CombinedOperator probInjector = (CombinedOperator)main.SubOperators[2]; 63 return probInjector.OperatorGraph.InitialOperator.SubOperators[0]; 63 64 } 64 65 set { 65 66 IOperator main = GetMainOperator(); 66 main.RemoveSubOperator(2); 67 main.AddSubOperator(value, 2); 67 CombinedOperator probInjector = (CombinedOperator)main.SubOperators[2]; 68 probInjector.OperatorGraph.InitialOperator.RemoveSubOperator(0); 69 probInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0); 68 70 } 69 71 } -
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearTimeSeriesPrognosis.cs
r2360 r2363 73 73 } 74 74 75 protected internal virtualIAnalyzerModel CreateLRModel(IScope bestModelScope) {75 protected override IAnalyzerModel CreateLRModel(IScope bestModelScope) { 76 76 var model = new AnalyzerModel(); 77 77 DefaultTimeSeriesOperators.PopulateAnalyzerModel(bestModelScope, model); -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
r2356 r2363 60 60 get { 61 61 IOperator main = GetMainOperator(); 62 return main.SubOperators[0].SubOperators[1]; 62 CombinedOperator probInject = (CombinedOperator)main.SubOperators[0].SubOperators[2]; 63 return probInject.OperatorGraph.InitialOperator.SubOperators[0]; 63 64 } 64 65 set { 65 66 IOperator main = GetMainOperator(); 66 main.RemoveSubOperator(1); 67 main.AddSubOperator(value, 1); 67 CombinedOperator probInject = (CombinedOperator)main.SubOperators[0].SubOperators[2]; 68 probInject.OperatorGraph.InitialOperator.RemoveSubOperator(0); 69 probInject.OperatorGraph.InitialOperator.AddSubOperator(value, 0); 68 70 } 69 71 } -
trunk/sources/HeuristicLab.sln
r2341 r2363 990 990 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|x64.Build.0 = Debug|x64 991 991 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|x86.ActiveCfg = Debug|x86 992 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|x86.Build.0 = Debug|x86 992 993 {1F1CF3ED-374C-4288-995B-93F6B872F571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 993 994 {1F1CF3ED-374C-4288-995B-93F6B872F571}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1422 1423 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|x64.ActiveCfg = Debug|x64 1423 1424 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|x86.ActiveCfg = Debug|x86 1424 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|x86.Build.0 = Debug|x861425 1425 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1426 1426 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3720 3720 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3721 3721 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3722 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU 3722 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3723 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.CEDMA Debug|x86.Build.0 = Debug|x86 3723 3724 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3724 3725 {E84E5717-79F8-498F-A5E0-A055C4EC086B}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3888 3889 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3889 3890 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3890 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.CEDMA Debug|x86.ActiveCfg = Debug| Any CPU3891 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3891 3892 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3892 3893 {3BD61258-31DA-4B09-89C0-4F71FEF5F05A}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3916 3917 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3917 3918 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3918 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.CEDMA Debug|x86.ActiveCfg = Debug| Any CPU3919 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3919 3920 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3920 3921 {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3944 3945 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3945 3946 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3946 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|x86.ActiveCfg = Debug| Any CPU3947 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3947 3948 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3948 3949 {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3972 3973 {1263BB36-1F20-4960-A5CB-530746DBAD77}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3973 3974 {1263BB36-1F20-4960-A5CB-530746DBAD77}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3974 {1263BB36-1F20-4960-A5CB-530746DBAD77}.CEDMA Debug|x86.ActiveCfg = Debug| Any CPU3975 {1263BB36-1F20-4960-A5CB-530746DBAD77}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3975 3976 {1263BB36-1F20-4960-A5CB-530746DBAD77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3976 3977 {1263BB36-1F20-4960-A5CB-530746DBAD77}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 4030 4031 {3127719F-110E-4558-8845-98559DBB422D}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 4031 4032 {3127719F-110E-4558-8845-98559DBB422D}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 4032 {3127719F-110E-4558-8845-98559DBB422D}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU 4033 {3127719F-110E-4558-8845-98559DBB422D}.CEDMA Debug|x86.ActiveCfg = Debug|x86 4034 {3127719F-110E-4558-8845-98559DBB422D}.CEDMA Debug|x86.Build.0 = Debug|x86 4033 4035 {3127719F-110E-4558-8845-98559DBB422D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 4034 4036 {3127719F-110E-4558-8845-98559DBB422D}.Debug|Any CPU.Build.0 = Debug|Any CPU
Note: See TracChangeset
for help on using the changeset viewer.