package jp.gr.java_conf.dyama.rink.ml.svm;

import jp.gr.java_conf.dyama.rink.ml.FeatureSpace;
import jp.gr.java_conf.dyama.rink.ml.FeatureVector;

/**
 * Learner
 * @author Hiroyasu Yamada
 *
 * @param <FS> the type of Feature SPcae: Real, Binary.
 */
public interface Learner<FS extends FeatureSpace>  {

    /**
     * add a training example.
     * @param x feature vector. throw IllegalArgumentException if x is null.
     * @param y label
     */
    public void addExample(FeatureVector<FS> x, int y);

    /**
     * learn SVM Classifiers by using added examples.
     * @param params paramters for learning. throw IllegalArgumentException if params is null.
     * @return SVM classifiers
     */
    public Classifier<? extends KernelFunction, FS> learn(Parameters params);


    /**
     * get the size of set of labels for added examples.
     * @return the size of set of labels
     */
    public int getSizeOfSetOfLabels();

    /**
     * get the default label for added examples. the default label is defined as follows:
     * most frequent labels.
     * if there are 2 more  most frequent labels, the default label is more earlier added label in the added examples.
     * @return default label. return null if no example has been added.
     */
    public Integer getDefaultLabel();


    /**
     * get the size of added examples.
     * @return the size of added examples.
     */
    public int getSizeOfExamples();


}

@@ -319,13 +319,16 @@
   * 
-add a
+Adds the
  tra
@@ -358,16 +358,20 @@
 param x 
+the 
 feature 
@@ -377,22 +377,58 @@
  vector.
- 
+%0A     * @param y the label.%0A     * @
 throw
+s
  Illegal
@@ -452,40 +452,35 @@
  if 
-x is null.%0A     * @param y label
+the feature vector is null.
 %0A   
@@ -561,16 +561,17 @@
  * learn
+s
  SVM Cla
@@ -582,33 +582,8 @@
 iers
- by using added examples.
 %0A   
@@ -600,21 +600,33 @@
  params 
+the set of 
 param
+e
 ters for
@@ -635,17 +635,57 @@
 earning.
- 
+%0A     * @return SVM classifiers.%0A     * @
 throw Il
@@ -710,21 +710,36 @@
 tion if 
+the set of 
 param
+eter
 s is nul
@@ -745,39 +745,8 @@
 ll.%0A
-     * @return SVM classifiers%0A
     
@@ -848,27 +848,45 @@
   * 
-g
+R
 et
+urns
  the 
-size of set
+number of different types
  of 
@@ -892,19 +892,22 @@
  labels 
-for
+in the
  added e
@@ -938,19 +938,33 @@
 the 
-size of set
+number of different types
  of 
@@ -1029,27 +1029,31 @@
  /**%0A     * 
-g
+R
 et
+urns
  the default
@@ -1062,30 +1062,11 @@
 abel
- for added examples
 . 
-t
+T
 he d
@@ -1107,16 +1107,20 @@
 :%0A     *
+ the
  most fr
@@ -1388,19 +1388,23 @@
 %0A     * 
-g
+R
 et
+urns
  the siz

revise API documents.