/** * Sets the name of the classifier, the learning rate, beta and the weight vector to the * specified values. Use this constructor to specify an alternative subclass of * {@link SparseWeightVector}. * * @param n The name of the classifier. * @param r The desired learning rate. * @param B The desired beta value. * @param v The desired weight vector. */ public BinaryMIRA(String n, double r, double B, SparseWeightVector v) { super(n); Parameters p = new Parameters(); p.learningRate = r; p.weightVector = v; p.beta = B; setParameters(p); }
/** * Retrieves the parameters that are set in this learner. * * @return An object containing all the values of the parameters that control the behavior of * this learning algorithm. **/ public Learner.Parameters getParameters() { Parameters p = new Parameters((SparsePerceptron.Parameters) super.getParameters()); p.beta = beta; return p; }