Changeset 2415 for trunk/sources/LibSVM/Parameter.cs
- Timestamp:
- 10/07/09 11:58:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/LibSVM/Parameter.cs
r1819 r2415 19 19 20 20 using System; 21 using System.Linq; 22 using System.Collections.Generic; 21 23 22 24 namespace SVM 23 25 { 24 /// < remarks>26 /// <summary> 25 27 /// Contains all of the types of SVM this library can model. 26 /// </ remarks>28 /// </summary> 27 29 public enum SvmType { 28 30 /// <summary> … … 47 49 NU_SVR 48 50 }; 49 /// < remarks>51 /// <summary> 50 52 /// Contains the various kernel types this library can use. 51 /// </ remarks>53 /// </summary> 52 54 public enum KernelType { 53 55 /// <summary> … … 73 75 }; 74 76 75 /// < remarks>77 /// <summary> 76 78 /// This class contains the various parameters which can affect the way in which an SVM 77 79 /// is learned. Unless you know what you are doing, chances are you are best off using 78 80 /// the default values. 79 /// </ remarks>81 /// </summary> 80 82 [Serializable] 81 83 public class Parameter : ICloneable … … 91 93 private double _eps; 92 94 93 private int _weightCount; 94 private int[] _weightLabels; 95 private double[] _weights; 95 private Dictionary<int, double> _weights; 96 96 private double _nu; 97 97 private double _p; … … 116 116 _shrinking = true; 117 117 _probability = false; 118 _weightCount = 0; 119 _weightLabels = new int[0]; 120 _weights = new double[0]; 118 _weights = new Dictionary<int, double>(); 121 119 } 122 120 … … 234 232 } 235 233 } 236 /// <summary> 237 /// Number of weights. 238 /// </summary> 239 public int WeightCount 240 { 241 get 242 { 243 return _weightCount; 244 } 245 set 246 { 247 _weightCount = value; 248 } 249 } 250 /// <summary> 251 /// Array of indicies corresponding to the Weights array (for C-SVC) 252 /// </summary> 253 public int[] WeightLabels 254 { 255 get 256 { 257 return _weightLabels; 258 } 259 set 260 { 261 _weightLabels = value; 262 } 263 } 264 /// <summary> 265 /// The parameter C of class i to weight*C in C-SVC (default 1) 266 /// </summary> 267 public double[] Weights 268 { 269 get 270 { 234 235 /// <summary> 236 /// Contains custom weights for class labels. Default weight value is 1. 237 /// </summary> 238 public Dictionary<int,double> Weights 239 { 240 get{ 271 241 return _weights; 272 242 } 273 set 274 { 275 _weights = value; 276 } 277 } 243 } 244 278 245 /// <summary> 279 246 /// The parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
Note: See TracChangeset
for help on using the changeset viewer.