- Timestamp:
- 06/25/15 13:46:24 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs
r12504 r12509 149 149 public static SupportVectorClassificationSolution CreateSupportVectorClassificationSolution(IClassificationProblemData problemData, IEnumerable<string> allowedInputVariables, 150 150 int svmType, int kernelType, double cost, double nu, double gamma, int degree, out double trainingAccuracy, out double testAccuracy, out int nSv) { 151 Datasetdataset = problemData.Dataset;151 var dataset = problemData.Dataset; 152 152 string targetVariable = problemData.TargetVariable; 153 153 IEnumerable<int> rows = problemData.TrainingIndices; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs
r12012 r12509 120 120 121 121 #region IRegressionModel Members 122 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {122 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 123 123 return GetEstimatedValuesHelper(dataset, rows); 124 124 } … … 132 132 133 133 #region IClassificationModel Members 134 public IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows) {134 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 135 135 if (classValues == null) throw new NotSupportedException(); 136 136 // return the original class value instead of the predicted value of the model … … 159 159 } 160 160 #endregion 161 private IEnumerable<double> GetEstimatedValuesHelper( Dataset dataset, IEnumerable<int> rows) {161 private IEnumerable<double> GetEstimatedValuesHelper(IDataset dataset, IEnumerable<int> rows) { 162 162 // calculate predictions for the currently requested rows 163 163 svm_problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineUtil.cs
r12012 r12509 40 40 /// <param name="rowIndices">The rows of the dataset that should be contained in the resulting SVM-problem</param> 41 41 /// <returns>A problem data type that can be used to train a support vector machine.</returns> 42 public static svm_problem CreateSvmProblem( Dataset dataset, string targetVariable, IEnumerable<string> inputVariables, IEnumerable<int> rowIndices) {42 public static svm_problem CreateSvmProblem(IDataset dataset, string targetVariable, IEnumerable<string> inputVariables, IEnumerable<int> rowIndices) { 43 43 double[] targetVector = dataset.GetDoubleValues(targetVariable, rowIndices).ToArray(); 44 44 svm_node[][] nodes = new svm_node[targetVector.Length][]; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r12504 r12509 152 152 string svmType, string kernelType, double cost, double nu, double gamma, double epsilon, int degree, 153 153 out double trainingR2, out double testR2, out int nSv) { 154 Datasetdataset = problemData.Dataset;154 var dataset = problemData.Dataset; 155 155 string targetVariable = problemData.TargetVariable; 156 156 IEnumerable<int> rows = problemData.TrainingIndices;
Note: See TracChangeset
for help on using the changeset viewer.