11package de .daslaboratorium .machinelearning .classifier ;
22
3+ import java .io .Serializable ;
34import java .util .Collection ;
45
56/**
6- * A basic wrapper reflecting a classification. It will store both featureset
7+ * A basic wrapper reflecting a classification. It will store both featureset
78 * and resulting classification.
89 *
910 * @author Philipp Nolte
1011 *
11- * @param <T> The feature class.
12- * @param <K> The category class.
12+ * @param <T>
13+ * The feature class.
14+ * @param <K>
15+ * The category class.
1316 */
14- public class Classification <T , K > {
17+ public class Classification <T , K > implements Serializable {
18+
19+ /**
20+ * Generated Serial Version UID (generated for v1.0.7).
21+ */
22+ private static final long serialVersionUID = -1210981535415341283L ;
1523
1624 /**
1725 * The classified featureset.
@@ -32,8 +40,10 @@ public class Classification<T, K> {
3240 * Constructs a new Classification with the parameters given and a default
3341 * probability of 1.
3442 *
35- * @param featureset The featureset.
36- * @param category The category.
43+ * @param featureset
44+ * The featureset.
45+ * @param category
46+ * The category.
3747 */
3848 public Classification (Collection <T > featureset , K category ) {
3949 this (featureset , category , 1.0f );
@@ -42,12 +52,14 @@ public Classification(Collection<T> featureset, K category) {
4252 /**
4353 * Constructs a new Classification with the parameters given.
4454 *
45- * @param featureset The featureset.
46- * @param category The category.
47- * @param probability The probability.
55+ * @param featureset
56+ * The featureset.
57+ * @param category
58+ * The category.
59+ * @param probability
60+ * The probability.
4861 */
49- public Classification (Collection <T > featureset , K category ,
50- float probability ) {
62+ public Classification (Collection <T > featureset , K category , float probability ) {
5163 this .featureset = featureset ;
5264 this .category = category ;
5365 this .probability = probability ;
@@ -64,6 +76,7 @@ public Collection<T> getFeatureset() {
6476
6577 /**
6678 * Retrieves the classification's probability.
79+ *
6780 * @return
6881 */
6982 public float getProbability () {
@@ -84,10 +97,8 @@ public K getCategory() {
8497 */
8598 @ Override
8699 public String toString () {
87- return "Classification [category=" + this .category
88- + ", probability=" + this .probability
89- + ", featureset=" + this .featureset
90- + "]" ;
100+ return "Classification [category=" + this .category + ", probability=" + this .probability + ", featureset="
101+ + this .featureset + "]" ;
91102 }
92103
93104}
0 commit comments