- Timestamp:
- 01/20/12 13:52:51 (13 years ago)
- Location:
- branches/HiveHiveEngine
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveHiveEngine
- Property svn:ignore
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 7294-7295,7297,7304-7306,7318,7327,7333,7335,7341-7342,7351-7353,7369-7370
-
branches/HiveHiveEngine/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r7097 r7383 101 101 </PropertyGroup> 102 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>103 <Reference Include="ALGLIB-3.4.0, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 104 <HintPath>..\..\bin\ALGLIB-3.4.0.dll</HintPath> 105 105 <Private>False</Private> 106 106 </Reference> -
branches/HiveHiveEngine/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r7259 r7383 73 73 kdTree.curdist = original.kdTree.curdist; 74 74 kdTree.debugcounter = original.kdTree.debugcounter; 75 kdTree.distmatrixtype = original.kdTree.distmatrixtype;76 75 kdTree.idx = (int[])original.kdTree.idx.Clone(); 77 76 kdTree.kcur = original.kdTree.kcur; … … 241 240 } 242 241 [Storable] 243 public int KDTreeDistMatrixType {244 get { return kdTree.distmatrixtype; }245 set { kdTree.distmatrixtype = value; }246 }247 [Storable]248 242 public int[] KDTreeIdx { 249 243 get { return kdTree.idx; } -
branches/HiveHiveEngine/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs.frame
r7259 r7383 28 28 [Plugin("HeuristicLab.Algorithms.DataAnalysis", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.2.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3. 1.0")]30 [PluginDependency("HeuristicLab.ALGLIB", "3.4.0")] 31 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 32 32 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HiveHiveEngine/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r7259 r7383 121 121 IRegressionProblemData problemData = Problem.ProblemData; 122 122 IEnumerable<string> selectedInputVariables = problemData.AllowedInputVariables; 123 var solution = CreateSupportVectorRegressionSolution(problemData, selectedInputVariables, SvmType.Value, KernelType.Value, Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value); 123 double trainR2, testR2; 124 int nSv; 125 var solution = CreateSupportVectorRegressionSolution(problemData, selectedInputVariables, SvmType.Value, 126 KernelType.Value, Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value, 127 out trainR2, out testR2, out nSv); 124 128 125 129 Results.Add(new Result("Support vector regression solution", "The support vector regression solution.", solution)); 130 Results.Add(new Result("Training R²", "The Pearson's R² of the SVR solution on the training partition.", new DoubleValue(trainR2))); 131 Results.Add(new Result("Test R²", "The Pearson's R² of the SVR solution on the test partition.", new DoubleValue(testR2))); 132 Results.Add(new Result("Number of support vectors", "The number of support vectors of the SVR solution.", new IntValue(nSv))); 126 133 } 127 134 128 135 public static SupportVectorRegressionSolution CreateSupportVectorRegressionSolution(IRegressionProblemData problemData, IEnumerable<string> allowedInputVariables, 129 string svmType, string kernelType, double cost, double nu, double gamma, double epsilon) { 136 string svmType, string kernelType, double cost, double nu, double gamma, double epsilon, 137 out double trainingR2, out double testR2, out int nSv) { 130 138 Dataset dataset = problemData.Dataset; 131 139 string targetVariable = problemData.TargetVariable; … … 147 155 SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem); 148 156 SVM.Problem scaledProblem = SVM.Scaling.Scale(rangeTransform, problem); 149 var model = new SupportVectorMachineModel(SVM.Training.Train(scaledProblem, parameter), rangeTransform, targetVariable, allowedInputVariables); 150 return new SupportVectorRegressionSolution(model, (IRegressionProblemData)problemData.Clone()); 157 var svmModel = SVM.Training.Train(scaledProblem, parameter); 158 nSv = svmModel.SupportVectorCount; 159 var model = new SupportVectorMachineModel(svmModel, rangeTransform, targetVariable, allowedInputVariables); 160 var solution = new SupportVectorRegressionSolution(model, (IRegressionProblemData)problemData.Clone()); 161 trainingR2 = solution.TrainingRSquared; 162 testR2 = solution.TestRSquared; 163 return solution; 151 164 } 152 165 #endregion
Note: See TracChangeset
for help on using the changeset viewer.