Changeset 3853 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs
- Timestamp:
- 05/20/10 10:21:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs
r3842 r3853 43 43 public SVM.Model Model { 44 44 get { return model; } 45 set { model = value; } 45 set { 46 if (value != model) { 47 if (value == null) throw new ArgumentNullException(); 48 model = value; 49 OnChanged(EventArgs.Empty); 50 } 51 } 46 52 } 47 53 … … 52 58 public SVM.RangeTransform RangeTransform { 53 59 get { return rangeTransform; } 54 set { rangeTransform = value; } 60 set { 61 if (value != rangeTransform) { 62 if (value == null) throw new ArgumentNullException(); 63 rangeTransform = value; 64 OnChanged(EventArgs.Empty); 65 } 66 } 55 67 } 68 69 public SupportVectorMachineModel() 70 : base() { 71 } 72 73 #region events 74 public event EventHandler Changed; 75 private void OnChanged(EventArgs e) { 76 var handlers = Changed; 77 if (handlers != null) 78 handlers(this, e); 79 } 80 #endregion 56 81 57 82 #region persistence … … 99 124 100 125 /// <summary> 101 /// Exports the <paramref name="model"/> in string representation to outputstream <paramref name="s"/>126 /// Exports the <paramref name="model"/> in string representation to stream <paramref name="s"/> 102 127 /// </summary> 103 128 /// <param name="model">The support vector regression model to export</param> 104 /// <param name="s">The outputstream to export the model to</param>129 /// <param name="s">The stream to export the model to</param> 105 130 public static void Export(SupportVectorMachineModel model, Stream s) { 106 131 StreamWriter writer = new StreamWriter(s); 107 132 writer.WriteLine("RangeTransform:"); 108 writer.Flush(); 133 writer.Flush(); 109 134 using (MemoryStream memStream = new MemoryStream()) { 110 135 SVM.RangeTransform.Write(memStream, model.RangeTransform);
Note: See TracChangeset
for help on using the changeset viewer.