- Timestamp:
- 05/16/12 16:28:49 (12 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 1 deleted
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r7268 r7842 72 72 rows = variableValues.First().Count; 73 73 this.variableNames = new List<string>(variableNames); 74 this.variableValues = new Dictionary<string, IList>( );74 this.variableValues = new Dictionary<string, IList>(this.variableNames.Count); 75 75 for (int i = 0; i < this.variableNames.Count; i++) { 76 76 var values = variableValues.ElementAt(i); … … 107 107 this.variableNames = new List<string>(variableNames); 108 108 109 this.variableValues = new Dictionary<string, IList>( );109 this.variableValues = new Dictionary<string, IList>(variableValues.GetLength(1)); 110 110 for (int col = 0; col < variableValues.GetLength(1); col++) { 111 111 string columName = this.variableNames[col]; 112 var values = new List<double>( );112 var values = new List<double>(variableValues.GetLength(0)); 113 113 for (int row = 0; row < variableValues.GetLength(0); row++) { 114 114 values.Add(variableValues[row, col]); -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r7460 r7842 146 146 <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" /> 147 147 <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" /> 148 <Compile Include="OnlineCalculators\OnlineMaxAbsoluteErrorCalculator.cs" /> 148 149 <Compile Include="OnlineCalculators\OnlineMeanErrorCalculator.cs" /> 149 150 <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" /> … … 204 205 </ItemGroup> 205 206 <ItemGroup> 206 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">207 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>208 <Name>HeuristicLab.Collections-3.3</Name>209 <Private>False</Private>210 </ProjectReference>211 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">212 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>213 <Name>HeuristicLab.Common.Resources-3.3</Name>214 <Private>False</Private>215 </ProjectReference>216 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">217 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>218 <Name>HeuristicLab.Common-3.3</Name>219 <Private>False</Private>220 </ProjectReference>221 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">222 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>223 <Name>HeuristicLab.Core-3.3</Name>224 <Private>False</Private>225 </ProjectReference>226 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">227 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>228 <Name>HeuristicLab.Data-3.3</Name>229 <Private>False</Private>230 </ProjectReference>231 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">232 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>233 <Name>HeuristicLab.Optimization-3.3</Name>234 <Private>False</Private>235 </ProjectReference>236 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">237 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>238 <Name>HeuristicLab.Parameters-3.3</Name>239 <Private>False</Private>240 </ProjectReference>241 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">242 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>243 <Name>HeuristicLab.Persistence-3.3</Name>244 <Private>False</Private>245 </ProjectReference>246 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">247 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>248 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>249 <Private>False</Private>250 </ProjectReference>251 </ItemGroup>252 <ItemGroup>253 207 <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> 254 208 <Visible>False</Visible> … … 267 221 </BootstrapperPackage> 268 222 </ItemGroup> 269 <ItemGroup /> 223 <ItemGroup> 224 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 225 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 226 <Name>HeuristicLab.Collections-3.3</Name> 227 <Private>False</Private> 228 </ProjectReference> 229 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 230 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 231 <Name>HeuristicLab.Common.Resources-3.3</Name> 232 <Private>False</Private> 233 </ProjectReference> 234 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 235 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 236 <Name>HeuristicLab.Common-3.3</Name> 237 <Private>False</Private> 238 </ProjectReference> 239 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 240 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 241 <Name>HeuristicLab.Core-3.3</Name> 242 <Private>False</Private> 243 </ProjectReference> 244 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 245 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 246 <Name>HeuristicLab.Data-3.3</Name> 247 <Private>False</Private> 248 </ProjectReference> 249 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 250 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 251 <Name>HeuristicLab.Optimization-3.3</Name> 252 <Private>False</Private> 253 </ProjectReference> 254 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 255 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 256 <Name>HeuristicLab.Parameters-3.3</Name> 257 <Private>False</Private> 258 </ProjectReference> 259 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 260 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 261 <Name>HeuristicLab.Persistence-3.3</Name> 262 <Private>False</Private> 263 </ProjectReference> 264 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 265 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 266 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 267 <Private>False</Private> 268 </ProjectReference> 269 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 270 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 271 <Name>HeuristicLab.Problems.Instances-3.3</Name> 272 <Private>False</Private> 273 </ProjectReference> 274 </ItemGroup> 270 275 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 271 276 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs
r7268 r7842 40 40 ProblemData = new ClassificationProblemData(); 41 41 } 42 43 public override void ImportProblemDataFromFile(string fileName) {44 ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);45 ProblemData = problemData;46 }47 42 } 48 43 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r7268 r7842 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.IO;25 24 using System.Linq; 26 25 using HeuristicLab.Common; … … 403 402 } 404 403 #endregion 405 406 #region Import from file407 public static ClassificationProblemData ImportFromFile(string fileName) {408 TableFileParser csvFileParser = new TableFileParser();409 csvFileParser.Parse(fileName);410 411 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);412 dataset.Name = Path.GetFileName(fileName);413 414 ClassificationProblemData problemData = new ClassificationProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());415 problemData.Name = "Data imported from " + Path.GetFileName(fileName);416 return problemData;417 }418 #endregion419 404 } 420 405 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs
r7268 r7842 38 38 ProblemData = new ClusteringProblemData(); 39 39 } 40 41 public override void ImportProblemDataFromFile(string fileName) {42 ClusteringProblemData problemData = ClusteringProblemData.ImportFromFile(fileName);43 ProblemData = problemData;44 }45 40 } 46 41 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs
r7268 r7842 21 21 22 22 using System.Collections.Generic; 23 using System.IO;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 90 89 : base(dataset, allowedInputVariables) { 91 90 } 92 93 94 #region Import from file95 public static ClusteringProblemData ImportFromFile(string fileName) {96 TableFileParser csvFileParser = new TableFileParser();97 csvFileParser.Parse(fileName);98 99 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);100 dataset.Name = Path.GetFileName(fileName);101 102 ClusteringProblemData problemData = new ClusteringProblemData(dataset, dataset.DoubleVariables);103 problemData.Name = "Data imported from " + Path.GetFileName(fileName);104 return problemData;105 }106 #endregion107 91 } 108 92 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r7268 r7842 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.Instances; 28 29 29 30 namespace HeuristicLab.Problems.DataAnalysis { 30 31 [StorableClass] 31 public abstract class DataAnalysisProblem<T> : Problem, 32 I DataAnalysisProblem<T>32 public abstract class DataAnalysisProblem<T> : Problem, IDataAnalysisProblem<T>, 33 IProblemInstanceConsumer<T>, IProblemInstanceExporter<T> 33 34 where T : class, IDataAnalysisProblemData { 34 35 private const string ProblemDataParameterName = "ProblemData"; … … 91 92 } 92 93 93 public abstract void ImportProblemDataFromFile(string fileName); 94 #region Import & Export 95 public void Load(T data) { 96 Name = data.Name; 97 Description = data.Description; 98 ProblemData = data; 99 OnReset(); 100 } 101 102 public T Export() { 103 return ProblemData; 104 } 105 #endregion 94 106 } 95 107 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r7268 r7842 97 97 98 98 RegisterRegressionSolutionsEventHandler(); 99 } 100 101 public RegressionEnsembleSolution(IRegressionProblemData problemData) 102 : this(Enumerable.Empty<IRegressionModel>(), problemData) { 99 103 } 100 104 -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
r7268 r7842 40 40 ProblemData = new RegressionProblemData(); 41 41 } 42 43 public override void ImportProblemDataFromFile(string fileName) {44 RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);45 ProblemData = problemData;46 }47 42 } 48 43 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r7268 r7842 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.IO;25 24 using System.Linq; 26 25 using HeuristicLab.Common; … … 136 135 OnChanged(); 137 136 } 138 139 #region Import from file140 public static RegressionProblemData ImportFromFile(string fileName) {141 TableFileParser csvFileParser = new TableFileParser();142 csvFileParser.Parse(fileName);143 144 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);145 dataset.Name = Path.GetFileName(fileName);146 147 RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());148 problemData.Name = "Data imported from " + Path.GetFileName(fileName);149 return problemData;150 }151 #endregion152 137 } 153 138 } -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
r7268 r7842 44 44 protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData) 45 45 : base(model, problemData) { 46 evaluationCache = new Dictionary<int, double>( );46 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 47 47 } 48 48 -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r7460 r7842 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Data; … … 166 165 167 166 protected void CalculateResults() { 168 double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values169 double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();170 double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values171 double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();167 IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values 168 IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes); 169 IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values 170 IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes); 172 171 173 172 OnlineCalculatorError errorState; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs
r7268 r7842 29 29 IDataAnalysisProblemData ProblemData { get; } 30 30 event EventHandler ProblemDataChanged; 31 32 void ImportProblemDataFromFile(string fileName);33 31 } 34 32 -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame
r7268 r7842 36 36 [PluginDependency("HeuristicLab.Parameters", "3.3")] 37 37 [PluginDependency("HeuristicLab.Persistence", "3.3")] 38 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 38 39 public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase { 39 40 }
Note: See TracChangeset
for help on using the changeset viewer.