- Timestamp:
- 10/05/11 21:55:55 (13 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 3 deleted
- 15 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP
- Property svn:ignore
-
old new 1 *.docstates 2 *.psess 1 3 *.resharper 2 4 *.suo 5 *.vsp 3 6 Google.ProtocolBuffers-0.9.1.dll 7 HeuristicLab 3.3.5.1.ReSharper.user 8 HeuristicLab 3.3.6.0.ReSharper.user 4 9 HeuristicLab.4.5.resharper.user 5 10 HeuristicLab.resharper.user … … 8 13 _ReSharper.HeuristicLab 9 14 _ReSharper.HeuristicLab 3.3 15 _ReSharper.HeuristicLab.ExtLibs 16 bin 10 17 protoc.exe 11 HeuristicLab 3.3.5.1.ReSharper.user 12 *.psess 13 *.vsp 14 *.docstates 18 HeuristicLab.ExtLibs.6.0.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:ignore
-
old new 4 4 HeuristicLab.Algorithms.DataAnalysis-3.4.csproj.user 5 5 *.vs10x 6 Plugin.cs
-
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r6587 r6878 43 43 <DebugType>full</DebugType> 44 44 <Optimize>false</Optimize> 45 <OutputPath> bin\Debug\</OutputPath>45 <OutputPath>$(SolutionDir)\bin\</OutputPath> 46 46 <DefineConstants>DEBUG;TRACE</DefineConstants> 47 47 <ErrorReport>prompt</ErrorReport> … … 52 52 <DebugType>pdbonly</DebugType> 53 53 <Optimize>true</Optimize> 54 <OutputPath> bin\Release\</OutputPath>54 <OutputPath>$(SolutionDir)\bin\</OutputPath> 55 55 <DefineConstants>TRACE</DefineConstants> 56 56 <ErrorReport>prompt</ErrorReport> 57 57 <WarningLevel>4</WarningLevel> 58 <DocumentationFile>bin\Release\HeuristicLab.Algorithms.DataAnalysis-3.4.xml</DocumentationFile> 58 <DocumentationFile> 59 </DocumentationFile> 59 60 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 60 61 </PropertyGroup> 61 62 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 62 63 <DebugSymbols>true</DebugSymbols> 63 <OutputPath> bin\x86\Debug\</OutputPath>64 <OutputPath>$(SolutionDir)\bin\</OutputPath> 64 65 <DefineConstants>DEBUG;TRACE</DefineConstants> 65 66 <DebugType>full</DebugType> … … 69 70 </PropertyGroup> 70 71 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 71 <OutputPath> bin\x86\Release\</OutputPath>72 <OutputPath>$(SolutionDir)\bin\</OutputPath> 72 73 <DefineConstants>TRACE</DefineConstants> 73 <DocumentationFile>bin\x86\Release\HeuristicLab.Algorithms.DataAnalysis-3.4.xml</DocumentationFile> 74 <DocumentationFile> 75 </DocumentationFile> 74 76 <Optimize>true</Optimize> 75 77 <DebugType>pdbonly</DebugType> … … 80 82 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 81 83 <DebugSymbols>true</DebugSymbols> 82 <OutputPath> bin\x64\Debug\</OutputPath>84 <OutputPath>$(SolutionDir)\bin\</OutputPath> 83 85 <DefineConstants>DEBUG;TRACE</DefineConstants> 84 86 <DebugType>full</DebugType> … … 88 90 </PropertyGroup> 89 91 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 90 <OutputPath> bin\x64\Release\</OutputPath>92 <OutputPath>$(SolutionDir)\bin\</OutputPath> 91 93 <DefineConstants>TRACE</DefineConstants> 92 <DocumentationFile>bin\x64\Release\HeuristicLab.Algorithms.DataAnalysis-3.3.xml</DocumentationFile> 94 <DocumentationFile> 95 </DocumentationFile> 93 96 <Optimize>true</Optimize> 94 97 <DebugType>pdbonly</DebugType> … … 98 101 </PropertyGroup> 99 102 <ItemGroup> 103 <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 104 <HintPath>..\..\bin\ALGLIB-3.1.0.dll</HintPath> 105 </Reference> 106 <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 107 <HintPath>..\..\bin\LibSVM-1.6.3.dll</HintPath> 108 </Reference> 100 109 <Reference Include="System" /> 101 110 <Reference Include="System.Core"> … … 107 116 </ItemGroup> 108 117 <ItemGroup> 109 <Compile Include="RegressionWorkbench.cs" />110 118 <Compile Include="CrossValidation.cs"> 111 119 <SubType>Code</SubType> 112 120 </Compile> 113 <Compile Include="HeuristicLabAlgorithmsDataAnalysisPlugin.cs" />114 121 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 115 122 <Compile Include="Interfaces\INearestNeighbourClassificationSolution.cs" /> … … 135 142 </Compile> 136 143 <Compile Include="Linear\AlglibUtil.cs" /> 144 <Compile Include="Linear\LinearTimeSeriesPrognosis.cs" /> 137 145 <Compile Include="Linear\LinearDiscriminantAnalysis.cs" /> 138 146 <Compile Include="Linear\LinearRegression.cs"> … … 157 165 <Compile Include="NeuralNetwork\NeuralNetworkRegression.cs" /> 158 166 <Compile Include="NeuralNetwork\NeuralNetworkRegressionSolution.cs" /> 167 <Compile Include="Plugin.cs" /> 159 168 <Compile Include="Properties\AssemblyInfo.cs" /> 160 169 <Compile Include="RandomForest\RandomForestClassificationSolution.cs" /> … … 180 189 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 181 190 <Name>HeuristicLab.Collections-3.3</Name> 191 <Private>False</Private> 182 192 </ProjectReference> 183 193 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 184 194 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 185 195 <Name>HeuristicLab.Common.Resources-3.3</Name> 196 <Private>False</Private> 186 197 </ProjectReference> 187 198 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 188 199 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 189 200 <Name>HeuristicLab.Common-3.3</Name> 201 <Private>False</Private> 190 202 </ProjectReference> 191 203 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 192 204 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 193 205 <Name>HeuristicLab.Core-3.3</Name> 206 <Private>False</Private> 194 207 </ProjectReference> 195 208 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 196 209 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 197 210 <Name>HeuristicLab.Data-3.3</Name> 211 <Private>False</Private> 198 212 </ProjectReference> 199 213 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj"> 200 214 <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project> 201 215 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name> 202 </ProjectReference> 203 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.1.0\ALGLIB-3.1.0\ALGLIB-3.1.0.csproj"> 204 <Project>{FC841674-62A7-4055-BE91-E41944B6C606}</Project> 205 <Name>ALGLIB-3.1.0</Name> 206 </ProjectReference> 207 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.1.0\HeuristicLab.ALGLIB-3.1.0\HeuristicLab.ALGLIB-3.1.0.csproj"> 208 <Project>{DE69A359-A5B8-4D3D-BA8D-D5780D7F96D6}</Project> 209 <Name>HeuristicLab.ALGLIB-3.1.0 %28HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\HeuristicLab.ALGLIB-3.1.0\HeuristicLab.ALGLIB-3.1.0%29</Name> 210 </ProjectReference> 211 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3.csproj"> 212 <Project>{89B50302-9CEE-4D13-9779-633EADCAE624}</Project> 213 <Name>HeuristicLab.LibSVM-1.6.3 %28HeuristicLab.ExtLibs\HeuristicLab.LibSVM\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3%29</Name> 214 </ProjectReference> 215 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\LibSVM-1.6.3\LibSVM-1.6.3.csproj"> 216 <Project>{A16F23B5-FB62-499E-A831-26953AA56FE2}</Project> 217 <Name>LibSVM-1.6.3</Name> 216 <Private>False</Private> 218 217 </ProjectReference> 219 218 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 220 219 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 221 220 <Name>HeuristicLab.Optimization-3.3</Name> 221 <Private>False</Private> 222 222 </ProjectReference> 223 223 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 224 224 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 225 225 <Name>HeuristicLab.Parameters-3.3</Name> 226 <Private>False</Private> 226 227 </ProjectReference> 227 228 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 228 229 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 229 230 <Name>HeuristicLab.Persistence-3.3</Name> 231 <Private>False</Private> 230 232 </ProjectReference> 231 233 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 232 234 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 233 235 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 236 <Private>False</Private> 234 237 </ProjectReference> 235 238 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj"> 236 239 <Project>{05BAE4E1-A9FA-4644-AA77-42558720159E}</Project> 237 240 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name> 241 <Private>False</Private> 238 242 </ProjectReference> 239 243 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj"> 240 244 <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project> 241 245 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name> 246 <Private>False</Private> 247 </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> 242 252 </ProjectReference> 243 253 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 244 254 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 245 255 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 256 <Private>False</Private> 246 257 </ProjectReference> 247 258 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj"> 248 259 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project> 249 260 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name> 261 <Private>False</Private> 250 262 </ProjectReference> 251 263 </ItemGroup> 252 264 <ItemGroup> 253 265 <None Include="HeuristicLab.snk" /> 254 <None Include=" HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame" />255 <None Include="Properties\AssemblyInfo. frame" />266 <None Include="Plugin.cs.frame" /> 267 <None Include="Properties\AssemblyInfo.cs.frame" /> 256 268 </ItemGroup> 257 269 <ItemGroup> … … 288 300 289 301 call PreBuildEvent.cmd 290 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabAlgorithmsDataAnalysisPlugin.cs"</PreBuildEvent>302 </PreBuildEvent> 291 303 </PropertyGroup> 292 304 </Project> -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/AlglibUtil.cs
r6002 r6878 27 27 public static class AlglibUtil { 28 28 public static double[,] PrepareInputMatrix(Dataset dataset, IEnumerable<string> variables, IEnumerable<int> rows) { 29 List<string> variablesList = variables.ToList(); 29 return PrepareInputMatrix(dataset, variables, rows, new int[] { 0 }); 30 } 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(); 30 42 List<int> rowsList = rows.ToList(); 43 int nRows = rowsList.Count - maxLag; 44 double[,] matrix = new double[nRows, inputVariablesList.Count * lags.Count() + 1]; 31 45 32 double[,] matrix = new double[rowsList.Count, variablesList.Count]; 33 for (int row = 0; row < rowsList.Count; row++) { 34 int col = 0; 35 foreach (string column in variables) { 36 matrix[row, col] = dataset[column, rowsList[row]]; 46 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 } 37 59 col++; 38 60 } 61 } 62 // target variable 63 row = 0; 64 foreach (var value in dataset.GetDoubleValues(targetVariable, rows).Take(nRows)) { 65 matrix[row, col] = value; 66 row++; 39 67 } 40 68 return matrix; -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs
r6685 r6878 78 78 int nRows = inputMatrix.GetLength(0); 79 79 int nFeatures = inputMatrix.GetLength(1) - 1; 80 double[] classValues = dataset.Get VariableValues(targetVariable).Distinct().OrderBy(x => x).ToArray();80 double[] classValues = dataset.GetDoubleValues(targetVariable).Distinct().OrderBy(x => x).ToArray(); 81 81 int nClasses = classValues.Count(); 82 82 // map original class values to values [0..nClasses-1] -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourClassification.cs
r6685 r6878 96 96 int nRows = inputMatrix.GetLength(0); 97 97 int nFeatures = inputMatrix.GetLength(1) - 1; 98 double[] classValues = dataset.Get VariableValues(targetVariable).Distinct().OrderBy(x => x).ToArray();98 double[] classValues = dataset.GetDoubleValues(targetVariable).Distinct().OrderBy(x => x).ToArray(); 99 99 int nClasses = classValues.Count(); 100 100 // map original class values to values [0..nClasses-1] -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs
r6685 r6878 113 113 private NeuralNetworkClassification(NeuralNetworkClassification original, Cloner cloner) 114 114 : base(original, cloner) { 115 RegisterEventHandlers(); 115 116 } 116 117 public NeuralNetworkClassification() 117 118 : base() { 118 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { new IntValue(0), new IntValue(1), new IntValue(2) }); 119 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 120 (IntValue)new IntValue(0).AsReadOnly(), 121 (IntValue)new IntValue(1).AsReadOnly(), 122 (IntValue)new IntValue(2).AsReadOnly() }); 119 123 var selectedHiddenLayerValue = (from v in validHiddenLayerValues 120 124 where v.Value == 1 … … 127 131 Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of restarts for learning.", new IntValue(2))); 128 132 133 RestartsParameter.Hidden = true; 134 NodesInSecondHiddenLayerParameter.Hidden = true; 135 136 RegisterEventHandlers(); 137 129 138 Problem = new ClassificationProblem(); 130 139 } 140 141 private void RegisterEventHandlers() { 142 HiddenLayersParameter.Value.ValueChanged += HiddenLayersParameterValueValueChanged; 143 HiddenLayersParameter.ValueChanged += HiddenLayersParameterValueChanged; 144 } 145 131 146 [StorableHook(HookType.AfterDeserialization)] 132 private void AfterDeserialization() { } 147 private void AfterDeserialization() { 148 RegisterEventHandlers(); 149 } 133 150 134 151 public override IDeepCloneable Clone(Cloner cloner) { 135 152 return new NeuralNetworkClassification(this, cloner); 153 } 154 private void HiddenLayersParameterValueChanged(object source, EventArgs e) { 155 HiddenLayersParameter.Value.ValueChanged += HiddenLayersParameterValueValueChanged; 156 HiddenLayersParameterValueValueChanged(this, EventArgs.Empty); 157 } 158 159 private void HiddenLayersParameterValueValueChanged(object source, EventArgs e) { 160 if (HiddenLayers == 0) { 161 NodesInFirstHiddenLayerParameter.Hidden = true; 162 NodesInSecondHiddenLayerParameter.Hidden = true; 163 } else if (HiddenLayers == 1) { 164 NodesInFirstHiddenLayerParameter.Hidden = false; 165 NodesInSecondHiddenLayerParameter.Hidden = true; 166 } else { 167 NodesInFirstHiddenLayerParameter.Hidden = false; 168 NodesInSecondHiddenLayerParameter.Hidden = false; 169 } 136 170 } 137 171 … … 158 192 int nRows = inputMatrix.GetLength(0); 159 193 int nFeatures = inputMatrix.GetLength(1) - 1; 160 double[] classValues = dataset.Get VariableValues(targetVariable).Distinct().OrderBy(x => x).ToArray();194 double[] classValues = dataset.GetDoubleValues(targetVariable).Distinct().OrderBy(x => x).ToArray(); 161 195 int nClasses = classValues.Count(); 162 196 // map original class values to values [0..nClasses-1] -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs
r6685 r6878 127 127 public NeuralNetworkEnsembleClassification() 128 128 : base() { 129 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { new IntValue(0), new IntValue(1), new IntValue(2) }); 129 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 130 (IntValue)new IntValue(0).AsReadOnly(), 131 (IntValue)new IntValue(1).AsReadOnly(), 132 (IntValue)new IntValue(2).AsReadOnly() }); 130 133 var selectedHiddenLayerValue = (from v in validHiddenLayerValues 131 134 where v.Value == 1 … … 139 142 Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of restarts for learning.", new IntValue(2))); 140 143 144 HiddenLayersParameter.Hidden = true; 145 NodesInFirstHiddenLayerParameter.Hidden = true; 146 NodesInSecondHiddenLayerParameter.Hidden = true; 147 RestartsParameter.Hidden = true; 148 141 149 Problem = new ClassificationProblem(); 142 150 } … … 170 178 int nRows = inputMatrix.GetLength(0); 171 179 int nFeatures = inputMatrix.GetLength(1) - 1; 172 double[] classValues = dataset.Get VariableValues(targetVariable).Distinct().OrderBy(x => x).ToArray();180 double[] classValues = dataset.GetDoubleValues(targetVariable).Distinct().OrderBy(x => x).ToArray(); 173 181 int nClasses = classValues.Count(); 174 182 // map original class values to values [0..nClasses-1] -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs
r6685 r6878 127 127 public NeuralNetworkEnsembleRegression() 128 128 : base() { 129 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { new IntValue(0), new IntValue(1), new IntValue(2) }); 129 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 130 (IntValue)new IntValue(0).AsReadOnly(), 131 (IntValue)new IntValue(1).AsReadOnly(), 132 (IntValue)new IntValue(2).AsReadOnly() }); 130 133 var selectedHiddenLayerValue = (from v in validHiddenLayerValues 131 134 where v.Value == 1 … … 138 141 Parameters.Add(new FixedValueParameter<IntValue>(NodesInSecondHiddenLayerParameterName, "The number of nodes in the second hidden layer. This value is not used if the number of hidden layers is zero or one.", new IntValue(100))); 139 142 Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of restarts for learning.", new IntValue(2))); 143 144 HiddenLayersParameter.Hidden = true; 145 NodesInFirstHiddenLayerParameter.Hidden = true; 146 NodesInSecondHiddenLayerParameter.Hidden = true; 147 RestartsParameter.Hidden = true; 140 148 141 149 Problem = new RegressionProblem(); -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
r6685 r6878 113 113 private NeuralNetworkRegression(NeuralNetworkRegression original, Cloner cloner) 114 114 : base(original, cloner) { 115 RegisterEventHandlers(); 115 116 } 116 117 public NeuralNetworkRegression() 117 118 : base() { 118 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { new IntValue(0), new IntValue(1), new IntValue(2) }); 119 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 120 (IntValue)new IntValue(0).AsReadOnly(), 121 (IntValue)new IntValue(1).AsReadOnly(), 122 (IntValue)new IntValue(2).AsReadOnly() }); 119 123 var selectedHiddenLayerValue = (from v in validHiddenLayerValues 120 124 where v.Value == 1 … … 127 131 Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of restarts for learning.", new IntValue(2))); 128 132 133 RestartsParameter.Hidden = true; 134 NodesInSecondHiddenLayerParameter.Hidden = true; 135 136 RegisterEventHandlers(); 137 129 138 Problem = new RegressionProblem(); 130 139 } 140 141 private void RegisterEventHandlers() { 142 HiddenLayersParameter.Value.ValueChanged += HiddenLayersParameterValueValueChanged; 143 HiddenLayersParameter.ValueChanged += HiddenLayersParameterValueChanged; 144 } 145 131 146 [StorableHook(HookType.AfterDeserialization)] 132 private void AfterDeserialization() { } 147 private void AfterDeserialization() { 148 RegisterEventHandlers(); 149 } 133 150 134 151 public override IDeepCloneable Clone(Cloner cloner) { 135 152 return new NeuralNetworkRegression(this, cloner); 136 153 } 154 155 private void HiddenLayersParameterValueChanged(object source, EventArgs e) { 156 HiddenLayersParameter.Value.ValueChanged += HiddenLayersParameterValueValueChanged; 157 HiddenLayersParameterValueValueChanged(this, EventArgs.Empty); 158 } 159 160 private void HiddenLayersParameterValueValueChanged(object source, EventArgs e) { 161 if (HiddenLayers == 0) { 162 NodesInFirstHiddenLayerParameter.Hidden = true; 163 NodesInSecondHiddenLayerParameter.Hidden = true; 164 } else if (HiddenLayers == 1) { 165 NodesInFirstHiddenLayerParameter.Hidden = false; 166 NodesInSecondHiddenLayerParameter.Hidden = true; 167 } else { 168 NodesInFirstHiddenLayerParameter.Hidden = false; 169 NodesInSecondHiddenLayerParameter.Hidden = false; 170 } 171 } 172 137 173 138 174 #region neural network … … 155 191 throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset."); 156 192 157 double targetMin = problemData.Dataset.GetEnumeratedVariableValues(targetVariable).Min();158 targetMin = targetMin - targetMin * 0.1; // -10%159 double targetMax = problemData.Dataset.GetEnumeratedVariableValues(targetVariable).Max();160 targetMax = targetMax + targetMax * 0.1; // + 10%161 162 193 alglib.multilayerperceptron multiLayerPerceptron = null; 163 194 if (nLayers == 0) { 164 alglib.mlpcreate r0(allowedInputVariables.Count(), 1, targetMin, targetMax, out multiLayerPerceptron);195 alglib.mlpcreate0(allowedInputVariables.Count(), 1, out multiLayerPerceptron); 165 196 } else if (nLayers == 1) { 166 alglib.mlpcreate r1(allowedInputVariables.Count(), nHiddenNodes1, 1, targetMin, targetMax, out multiLayerPerceptron);197 alglib.mlpcreate1(allowedInputVariables.Count(), nHiddenNodes1, 1, out multiLayerPerceptron); 167 198 } else if (nLayers == 2) { 168 alglib.mlpcreate r2(allowedInputVariables.Count(), nHiddenNodes1, nHiddenNodes2, 1, targetMin, targetMax, out multiLayerPerceptron);199 alglib.mlpcreate2(allowedInputVariables.Count(), nHiddenNodes1, nHiddenNodes2, 1, out multiLayerPerceptron); 169 200 } else throw new ArgumentException("Number of layers must be zero, one, or two.", "nLayers"); 170 201 alglib.mlpreport rep; … … 177 208 178 209 rmsError = alglib.mlprmserror(multiLayerPerceptron, inputMatrix, nRows); 179 avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows); 210 avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows); 180 211 181 212 return new NeuralNetworkRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables)); -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs
r6685 r6878 108 108 int nCols = inputMatrix.GetLength(1); 109 109 int info; 110 double[] classValues = dataset.Get VariableValues(targetVariable).Distinct().OrderBy(x => x).ToArray();110 double[] classValues = dataset.GetDoubleValues(targetVariable).Distinct().OrderBy(x => x).ToArray(); 111 111 int nClasses = classValues.Count(); 112 112 // map original class values to values [0..nClasses-1] -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs
r6240 r6878 88 88 Problem = new ClassificationProblem(); 89 89 90 List<StringValue> svrTypes = (from type in new List<string> { "NU_SVC", " EPSILON_SVC" }90 List<StringValue> svrTypes = (from type in new List<string> { "NU_SVC", "C_SVC" } 91 91 select new StringValue(type).AsReadOnly()) 92 92 .ToList(); … … 134 134 parameter.Probability = false; 135 135 136 foreach (double c in problemData.ClassValues) { 137 double wSum = 0.0; 138 foreach (double otherClass in problemData.ClassValues) { 139 if (!c.IsAlmost(otherClass)) { 140 wSum += problemData.GetClassificationPenalty(c, otherClass); 141 } 142 } 143 parameter.Weights.Add((int)c, wSum); 144 } 145 136 146 137 147 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows); -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineUtil.cs
r6002 r6878 34 34 public static SVM.Problem CreateSvmProblem(Dataset dataset, string targetVariable, IEnumerable<string> inputVariables, IEnumerable<int> rowIndices) { 35 35 double[] targetVector = 36 dataset.GetEnumeratedVariableValues(targetVariable, rowIndices) 37 .ToArray(); 36 dataset.GetDoubleValues(targetVariable, rowIndices).ToArray(); 38 37 39 38 SVM.Node[][] nodes = new SVM.Node[targetVector.Length][]; … … 46 45 int colIndex = 1; // make sure the smallest node index for SVM = 1 47 46 foreach (var inputVariable in inputVariablesList) { 48 double value = dataset [row, dataset.GetVariableIndex(inputVariable)];47 double value = dataset.GetDoubleValue(inputVariable, row); 49 48 // SVM also works with missing values 50 49 // => don't add NaN values in the dataset to the sparse SVM matrix representation -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r6240 r6878 143 143 parameter.Probability = false; 144 144 145 146 145 SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows); 147 146 SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem); -
branches/GeneralizedQAP/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringUtil.cs
r5809 r6878 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Problems.DataAnalysis; 25 using System;26 26 27 27 namespace HeuristicLab.Algorithms.DataAnalysis { … … 42 42 int col = 0; 43 43 foreach (var inputVariable in allowedInputVariables) { 44 double d = center[col++] - dataset [inputVariable, row];44 double d = center[col++] - dataset.GetDoubleValue(inputVariable, row); 45 45 d = d * d; // square; 46 46 centerDistance += d; … … 73 73 double[] p = new double[allowedInputVariables.Count]; 74 74 for (int i = 0; i < nCols; i++) { 75 p[i] = dataset [allowedInputVariables[i], row];75 p[i] = dataset.GetDoubleValue(allowedInputVariables[i], row); 76 76 } 77 77 clusterPoints[clusterValues[clusterValueIndex++]].Add(p);
Note: See TracChangeset
for help on using the changeset viewer.