- Timestamp:
- 12/20/11 13:54:57 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 4 4 *.suo 5 5 *.vsp 6 Doxygen 6 7 Google.ProtocolBuffers-0.9.1.dll 7 8 HeuristicLab 3.3.5.1.ReSharper.user 8 9 HeuristicLab 3.3.6.0.ReSharper.user 9 10 HeuristicLab.4.5.resharper.user 11 HeuristicLab.ExtLibs.6.0.ReSharper.user 10 12 HeuristicLab.resharper.user 11 13 ProtoGen.exe … … 16 18 bin 17 19 protoc.exe 18 HeuristicLab.ExtLibs.6.0.ReSharper.user19 Doxygen
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLab.Algorithms.DataAnalysis-3.3.csproj
r6866 r7215 117 117 </ItemGroup> 118 118 <ItemGroup> 119 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 120 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 121 <Name>HeuristicLab.Collections-3.3</Name> 122 <Private>False</Private> 123 </ProjectReference> 124 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 125 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 126 <Name>HeuristicLab.Common.Resources-3.3</Name> 127 <Private>False</Private> 128 </ProjectReference> 129 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 130 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 131 <Name>HeuristicLab.Common-3.3</Name> 132 <Private>False</Private> 133 </ProjectReference> 134 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 135 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 136 <Name>HeuristicLab.Core-3.3</Name> 137 <Private>False</Private> 138 </ProjectReference> 139 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 140 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 141 <Name>HeuristicLab.Data-3.3</Name> 142 <Private>False</Private> 143 </ProjectReference> 144 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj"> 145 <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project> 146 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name> 147 <Private>False</Private> 148 </ProjectReference> 149 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 150 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 151 <Name>HeuristicLab.Operators-3.3</Name> 152 <Private>False</Private> 153 </ProjectReference> 154 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 155 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 156 <Name>HeuristicLab.Optimization-3.3</Name> 157 <Private>False</Private> 158 </ProjectReference> 159 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 160 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 161 <Name>HeuristicLab.Parameters-3.3</Name> 162 <Private>False</Private> 163 </ProjectReference> 164 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 165 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 166 <Name>HeuristicLab.Persistence-3.3</Name> 167 <Private>False</Private> 168 </ProjectReference> 169 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 170 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 171 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 172 <Private>False</Private> 173 </ProjectReference> 174 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj"> 175 <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project> 176 <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name> 177 <Private>False</Private> 178 </ProjectReference> 179 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj"> 180 <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project> 181 <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name> 182 <Private>False</Private> 183 </ProjectReference> 119 <Reference Include="HeuristicLab.Collections-3.3"> 120 <HintPath>..\..\bin\HeuristicLab.Collections-3.3.dll</HintPath> 121 <Private>False</Private> 122 </Reference> 123 <Reference Include="HeuristicLab.Common.Resources-3.3"> 124 <HintPath>..\..\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 125 <Private>False</Private> 126 </Reference> 127 <Reference Include="HeuristicLab.Common-3.3"> 128 <HintPath>..\..\bin\HeuristicLab.Common-3.3.dll</HintPath> 129 <Private>False</Private> 130 </Reference> 131 <Reference Include="HeuristicLab.Core-3.3"> 132 <HintPath>..\..\bin\HeuristicLab.Core-3.3.dll</HintPath> 133 <Private>False</Private> 134 </Reference> 135 <Reference Include="HeuristicLab.Data-3.3"> 136 <HintPath>..\..\bin\HeuristicLab.Data-3.3.dll</HintPath> 137 <Private>False</Private> 138 </Reference> 139 <Reference Include="HeuristicLab.Operators-3.3"> 140 <HintPath>..\..\bin\HeuristicLab.Operators-3.3.dll</HintPath> 141 <Private>False</Private> 142 </Reference> 143 <Reference Include="HeuristicLab.Optimization-3.3"> 144 <HintPath>..\..\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 145 <Private>False</Private> 146 </Reference> 147 <Reference Include="HeuristicLab.Parameters-3.3"> 148 <HintPath>..\..\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 149 <Private>False</Private> 150 </Reference> 151 <Reference Include="HeuristicLab.Persistence-3.3"> 152 <HintPath>..\..\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 153 <Private>False</Private> 154 </Reference> 155 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 156 <HintPath>..\..\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 157 <Private>False</Private> 158 </Reference> 184 159 </ItemGroup> 185 160 <ItemGroup> … … 204 179 <Install>true</Install> 205 180 </BootstrapperPackage> 181 </ItemGroup> 182 <ItemGroup> 183 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj"> 184 <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project> 185 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name> 186 <Private>False</Private> 187 </ProjectReference> 188 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj"> 189 <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project> 190 <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name> 191 <Private>False</Private> 192 </ProjectReference> 193 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj"> 194 <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project> 195 <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name> 196 <Private>False</Private> 197 </ProjectReference> 206 198 </ItemGroup> 207 199 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r6636 r7215 278 278 int testEnd = (i + 1) == Folds.Value ? SamplesEnd.Value : (i + 1) * testSamplesCount + SamplesStart.Value; 279 279 280 problem.ProblemData.TrainingPartition.Start = SamplesStart.Value; 281 problem.ProblemData.TrainingPartition.End = SamplesEnd.Value; 280 282 problem.ProblemData.TestPartition.Start = testStart; 281 283 problem.ProblemData.TestPartition.End = testEnd; … … 515 517 throw new InvalidOperationException("Can not change number of folds if the execution state is not prepared."); 516 518 } 519 520 private bool samplesChanged = false; 517 521 private void SamplesStart_ValueChanged(object sender, EventArgs e) { 522 samplesChanged = true; 518 523 if (Problem != null) Problem.ProblemData.TrainingPartition.Start = SamplesStart.Value; 524 samplesChanged = false; 519 525 } 520 526 private void SamplesEnd_ValueChanged(object sender, EventArgs e) { 527 samplesChanged = true; 521 528 if (Problem != null) Problem.ProblemData.TrainingPartition.End = SamplesEnd.Value; 529 samplesChanged = false; 522 530 } 523 531 … … 543 551 throw new ArgumentException("A cross validation algorithm can only contain DataAnalysisProblems."); 544 552 } 545 algorithm.Problem.Reset += (x, y) => OnProblemChanged();553 algorithm.Problem.Reset += (x, y) => OnProblemChanged(); 546 554 problem = (IDataAnalysisProblem)algorithm.Problem; 547 555 OnProblemChanged(); … … 551 559 EventHandler handler = ProblemChanged; 552 560 if (handler != null) handler(this, EventArgs.Empty); 561 if (samplesChanged) return; 553 562 554 563 SamplesStart.Value = 0; -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r6866 r7215 103 103 <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 104 104 <HintPath>..\..\bin\ALGLIB-3.1.0.dll</HintPath> 105 <Private>False</Private> 105 106 </Reference> 106 107 <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 107 108 <HintPath>..\..\bin\LibSVM-1.6.3.dll</HintPath> 109 <Private>False</Private> 108 110 </Reference> 109 111 <Reference Include="System" /> … … 142 144 </Compile> 143 145 <Compile Include="Linear\AlglibUtil.cs" /> 144 <Compile Include="Linear\LinearTimeSeriesPrognosis.cs" />145 146 <Compile Include="Linear\LinearDiscriminantAnalysis.cs" /> 146 147 <Compile Include="Linear\LinearRegression.cs"> … … 246 247 <Private>False</Private> 247 248 </ProjectReference> 248 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj">249 <Project>{07486E68-1517-4B9D-A58D-A38E99AE71AB}</Project>250 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4</Name>251 <Private>False</Private>252 </ProjectReference>253 249 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 254 250 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/AlglibUtil.cs
r6802 r7215 27 27 public static class AlglibUtil { 28 28 public static double[,] PrepareInputMatrix(Dataset dataset, IEnumerable<string> variables, IEnumerable<int> rows) { 29 return PrepareInputMatrix(dataset, variables, rows, new int[] { 0 });30 }29 List<string> variablesList = variables.ToList(); 30 List<int> rowsList = rows.ToList(); 31 31 32 public static double[,] PrepareInputMatrix(Dataset dataset, IEnumerable<string> variables, IEnumerable<int> rows, IEnumerable<int> lags) { 33 int maxLag = lags.Max(); 34 35 // drop last variable (target variable) 36 List<string> inputVariablesList = variables 37 .Reverse() 38 .Skip(1) 39 .Reverse() 40 .ToList(); 41 string targetVariable = variables.Last(); 42 List<int> rowsList = rows.ToList(); 43 int nRows = rowsList.Count - maxLag; 44 double[,] matrix = new double[nRows, inputVariablesList.Count * lags.Count() + 1]; 32 double[,] matrix = new double[rowsList.Count, variablesList.Count]; 45 33 46 34 int col = 0; 47 int row = 0; 48 // input variables 49 foreach (int lag in lags) { 50 foreach (string column in inputVariablesList) { 51 var values = dataset.GetDoubleValues(column, rows.Select(x => x - lag).Take(nRows)); 52 row = 0; 53 foreach (var value in values) { 54 if (row >= 0) { 55 matrix[row, col] = value; 56 } 57 row++; 58 } 59 col++; 35 foreach (string column in variables) { 36 var values = dataset.GetDoubleValues(column, rows); 37 int row = 0; 38 foreach (var value in values) { 39 matrix[row, col] = value; 40 row++; 60 41 } 42 col++; 61 43 } 62 // target variable 63 row = 0; 64 foreach (var value in dataset.GetDoubleValues(targetVariable, rows).Take(nRows)) { 65 matrix[row, col] = value; 66 row++; 67 } 44 68 45 return matrix; 69 46 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassificationSolution.cs
r6589 r7215 51 51 return new NeuralNetworkClassificationSolution(this, cloner); 52 52 } 53 54 53 protected override void RecalculateResults() { 55 54 CalculateResults(); -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs.frame
r6866 r7215 42 42 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification", "3.4")] 43 43 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")] 44 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis", "3.4")]45 44 public class HeuristicLabAlgorithmsDataAnalysisPlugin : PluginBase { 46 45 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs
r6604 r7215 98 98 this.targetVariable = original.targetVariable; 99 99 this.allowedInputVariables = (string[])original.allowedInputVariables.Clone(); 100 foreach (var dataset in original.cachedPredictions.Keys) {101 this.cachedPredictions.Add(cloner.Clone(dataset), (double[])original.cachedPredictions[dataset].Clone());102 }103 100 if (original.classValues != null) 104 101 this.classValues = (double[])original.classValues.Clone(); … … 162 159 } 163 160 #endregion 164 // cache for predictions, which is cloned but not persisted, must be cleared when the model is changed165 private Dictionary<Dataset, double[]> cachedPredictions = new Dictionary<Dataset, double[]>();166 161 private IEnumerable<double> GetEstimatedValuesHelper(Dataset dataset, IEnumerable<int> rows) { 167 if (!cachedPredictions.ContainsKey(dataset)) { 168 // create an array of cached predictions which is initially filled with NaNs 169 double[] predictions = Enumerable.Repeat(double.NaN, dataset.Rows).ToArray(); 170 CalculatePredictions(dataset, rows, predictions); 171 cachedPredictions.Add(dataset, predictions); 172 } 173 // get the array of predictions and select the subset of requested rows 174 double[] p = cachedPredictions[dataset]; 175 var requestedPredictions = from r in rows 176 select p[r]; 177 // check if the requested predictions contain NaNs 178 // (this means for the request rows some predictions have not been cached) 179 if (requestedPredictions.Any(x => double.IsNaN(x))) { 180 // updated the predictions for currently requested rows 181 CalculatePredictions(dataset, rows, p); 182 cachedPredictions[dataset] = p; 183 // now we can be sure that for the current rows all predictions are available 184 return from r in rows 185 select p[r]; 186 } else { 187 // there were no NaNs => just return the cached predictions 188 return requestedPredictions; 189 } 190 } 191 192 private void CalculatePredictions(Dataset dataset, IEnumerable<int> rows, double[] predictions) { 193 // calculate and cache predictions for the currently requested rows 162 // calculate predictions for the currently requested rows 194 163 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows); 195 164 SVM.Problem scaledProblem = Scaling.Scale(RangeTransform, problem); 196 165 197 // row is the index in the original dataset, 198 // i is the index in the scaled dataset (containing only the necessary rows) 199 int i = 0; 200 foreach (var row in rows) { 201 predictions[row] = SVM.Prediction.Predict(Model, scaledProblem.X[i]); 202 i++; 166 for (int i = 0; i < scaledProblem.Count; i++) { 167 yield return SVM.Prediction.Predict(Model, scaledProblem.X[i]); 203 168 } 204 169 } … … 207 172 public event EventHandler Changed; 208 173 private void OnChanged(EventArgs e) { 209 cachedPredictions.Clear();210 174 var handlers = Changed; 211 175 if (handlers != null) -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r6802 r7215 143 143 parameter.Probability = false; 144 144 145 145 146 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows); 146 147 SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
Note: See TracChangeset
for help on using the changeset viewer.