Changeset 13928
- Timestamp:
- 06/20/16 16:38:54 (8 years ago)
- Location:
- branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4
-
Property
svn:ignore
set to
.vs
bin
*.user
obj
Plugin.cs
-
Property
svn:ignore
set to
-
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/ElasticNetLinearRegression.cs
r13927 r13928 58 58 var nCoeff = coeff.GetLength(1); 59 59 var dataRows = new DataRow[nCoeff]; 60 var allowedVars = Problem.ProblemData.AllowedInputVariables.ToArray(); 60 61 for (int i = 0; i < nCoeff; i++) { 61 var coeffId = string.Format("c_{0}", i); 62 dataRows[i] = new DataRow(coeffId, coeffId, Enumerable.Range(0, nLambdas).Select(r => coeff[r, i]).ToArray()); 62 var coeffId = allowedVars[i]; 63 var path = Enumerable.Range(0, nLambdas).Select(r => coeff[r, i]).ToArray(); 64 dataRows[i] = new DataRow(coeffId, coeffId, path); 63 65 coeffTable.Rows.Add(dataRows[i]); 64 66 } … … 68 70 var rsqTable = new DataTable("R-Squared", "Path of R² values over different lambda values"); 69 71 rsqTable.Rows.Add(new DataRow("R-Squared", "Path of R² values over different lambda values", rsq)); 70 Results.Add(new Result(rsqTable.Name, rsqTable.Description, coeffTable)); 71 } 72 73 // private static void TestTower() { 74 // var prov = new HeuristicLab.Problems.Instances.DataAnalysis.RegressionRealWorldInstanceProvider(); 75 // var towerDesc = prov.GetDataDescriptors().Where(dd => dd.Name.Contains("Tower")).Single(); 76 // try { 77 // var problemData = prov.LoadData(towerDesc); 78 // 79 // double[] lambda; 80 // double[] rsq; 81 // double[,] coeff; 82 // double[] intercept; 83 // RunElasticNetLinearRegression(problemData, 0.5, out lambda, out rsq, out coeff, out intercept); 84 // 85 // for (int i = 0; i < rsq.Length; i++) { 86 // Console.WriteLine(rsq[i]); 87 // } 88 // 89 // double rsq0; 90 // CreateElasticNetLinearRegressionSolution(problemData, 0.5, lambda.Skip(20).First(), out rsq0); 91 // 92 // CreateElasticNetLinearRegressionSolution(problemData, 0.5, lambda.Skip(20).Take(10).ToArray(), out rsq); 93 // 94 // 95 // } 96 // catch (Exception e) { 97 // } 98 // } 72 Results.Add(new Result(rsqTable.Name, rsqTable.Description, rsqTable)); 73 } 99 74 100 75 public static double[] CreateElasticNetLinearRegressionSolution(IRegressionProblemData problemData, double penalty, double lambda, -
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/HeuristicLab.Algorithms.DataAnalysis.Glmnet.csproj
r13927 r13928 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 10 <RootNamespace>HeuristicLab.Algorithms.DataAnalysis.Glmnet</RootNamespace> 11 <AssemblyName>HeuristicLab.Algorithms.DataAnalysis.Glmnet </AssemblyName>11 <AssemblyName>HeuristicLab.Algorithms.DataAnalysis.Glmnet-3.4</AssemblyName> 12 12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> … … 45 45 </PropertyGroup> 46 46 <ItemGroup> 47 <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4 ">47 <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 48 48 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath> 49 <SpecificVersion>False</SpecificVersion> 50 <Private>False</Private> 49 51 </Reference> 50 <Reference Include="HeuristicLab.Analysis-3.3 ">52 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 51 53 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 54 <SpecificVersion>False</SpecificVersion> 55 <Private>False</Private> 52 56 </Reference> 53 57 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 58 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 54 59 <SpecificVersion>False</SpecificVersion> 55 < HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>60 <Private>False</Private> 56 61 </Reference> 57 <Reference Include="HeuristicLab.Common-3.3 ">62 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 58 63 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 64 <SpecificVersion>False</SpecificVersion> 65 <Private>False</Private> 59 66 </Reference> 60 <Reference Include="HeuristicLab.Core-3.3 ">67 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 61 68 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 69 <SpecificVersion>False</SpecificVersion> 70 <Private>False</Private> 62 71 </Reference> 63 <Reference Include="HeuristicLab.Data-3.3 ">72 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 64 73 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 74 <SpecificVersion>False</SpecificVersion> 75 <Private>False</Private> 65 76 </Reference> 66 77 <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 78 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 67 79 <SpecificVersion>False</SpecificVersion> 68 < HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>80 <Private>False</Private> 69 81 </Reference> 70 <Reference Include="HeuristicLab.Parameters-3.3 ">82 <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 71 83 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 84 <SpecificVersion>False</SpecificVersion> 85 <Private>False</Private> 72 86 </Reference> 73 87 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 88 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 74 89 <SpecificVersion>False</SpecificVersion> 75 < HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>90 <Private>False</Private> 76 91 </Reference> 77 <Reference Include="HeuristicLab.PluginInfrastructure-3.3 ">92 <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 78 93 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 94 <SpecificVersion>False</SpecificVersion> 95 <Private>False</Private> 79 96 </Reference> 80 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4 ">97 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 98 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 99 <SpecificVersion>False</SpecificVersion> 100 <Private>False</Private> 82 101 </Reference> 83 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec" /> 102 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 103 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 104 <SpecificVersion>False</SpecificVersion> 105 <Private>False</Private> 106 </Reference> 84 107 <Reference Include="System" /> 85 108 <Reference Include="System.Core" /> … … 93 116 </ItemGroup> 94 117 <ItemGroup> 118 <None Include="Build.cmd" /> 95 119 <None Include="HeuristicLab.snk" /> 96 120 <None Include="Plugin.cs.frame" /> 121 <None Include="PreBuildEvent.cmd" /> 97 122 <None Include="Properties\AssemblyInfo.cs.frame" /> 98 123 </ItemGroup> 99 124 <ItemGroup> 125 <Content Include="glmnet-license-gpl2.txt" /> 100 126 <Content Include="glmnet-x64.dll"> 101 127 <CopyToOutputDirectory>Always</CopyToOutputDirectory> … … 107 133 <ItemGroup> 108 134 <Compile Include="ElasticNetLinearRegression.cs" /> 135 <Compile Include="Plugin.cs"> 136 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 137 </Compile> 138 <Compile Include="Properties\AssemblyInfo.cs" /> 109 139 </ItemGroup> 110 140 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> … … 116 146 </Target> 117 147 --> 148 <PropertyGroup> 149 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 150 set ProjectDir=$(ProjectDir) 151 set SolutionDir=$(SolutionDir) 152 set Outdir=$(Outdir) 153 154 call PreBuildEvent.cmd 155 </PreBuildEvent> 156 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 157 export ProjectDir=$(ProjectDir) 158 export SolutionDir=$(SolutionDir) 159 160 $SolutionDir/PreBuildEvent.sh 161 </PreBuildEvent> 162 </PropertyGroup> 118 163 </Project> -
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/Plugin.cs.frame
r13927 r13928 26 26 /// Plugin class for HeuristicLab.Algorithms.DataAnalysis.Glmnet plugin which wraps the glmnet implementation by Jerome Friedman, Trevor Hastie, Noah Simon, Rob Tibshirani, see https://cran.r-project.org/web/packages/glmnet/index.html 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.DataAnalysis.Glmnet", " ///Plugin class for HeuristicLab.Algorithms.DataAnalysis.Glmnet plugin which wraps the glmnet implementation by Jerome Friedman, Trevor Hastie, Noah Simon, Rob Tibshirani, see https://cran.r-project.org/web/packages/glmnet/index.html", "3.4.1.$WCREV$")]28 [Plugin("HeuristicLab.Algorithms.DataAnalysis.Glmnet", "Plugin class for HeuristicLab.Algorithms.DataAnalysis.Glmnet plugin which wraps the glmnet implementation by Jerome Friedman, Trevor Hastie, Noah Simon, Rob Tibshirani, see https://cran.r-project.org/web/packages/glmnet/index.html", "3.4.1.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.DataAnalysis.Glmnet-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginFile("glmnet-x86.dll", PluginFileType.NativeDll)] 31 31 [PluginFile("glmnet-x64.dll", PluginFileType.NativeDll)] 32 [PluginFile("glmnet-license-gpl2.txt", PluginFileType.License)] 33 [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")] 34 [PluginDependency("HeuristicLab.Analysis", "3.3")] 35 [PluginDependency("HeuristicLab.Collections", "3.3")] 36 [PluginDependency("HeuristicLab.Common", "3.3")] 37 [PluginDependency("HeuristicLab.Core", "3.3")] 38 [PluginDependency("HeuristicLab.Data", "3.3")] 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 [PluginDependency("HeuristicLab.Parameters", "3.3")] 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] 42 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 43 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 32 44 public class HeuristicLabAlgorithmsDataAnalysisGlmnetPlugin : PluginBase { 33 45 } -
branches/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/Properties
-
Property
svn:ignore
set to
AssemblyInfo.cs
-
Property
svn:ignore
set to
Note: See TracChangeset
for help on using the changeset viewer.