/** * Calls the appropriate <code>Learner.setParameters(Parameters)</code> method for this * <code>Parameters</code> object. * * @param l The learner whose parameters will be set. **/ public void setParameters(Learner l) { ((SparseAveragedPerceptron) l).setParameters(this); } }
/** * Initializing constructor. Sets all member variables to their associated settings in the * {@link SparseAveragedPerceptron.Parameters} object. * * @param n The name of the classifier. * @param p The settings of all parameters. **/ public SparseAveragedPerceptron(String n, SparseAveragedPerceptron.Parameters p) { super(n); setParameters(p); }
/** * Use this constructor to fit a thick separator, where the positive and negative sides of the * hyperplane will be given the specified separate thicknesses. * * @param n The name of the classifier. * @param r The desired learning rate value. * @param t The desired threshold value. * @param pt The desired positive thickness. * @param nt The desired negative thickness. **/ public SparseAveragedPerceptron(String n, double r, double t, double pt, double nt) { super(n); Parameters p = new Parameters(); p.learningRate = r; p.threshold = t; p.positiveThickness = pt; p.negativeThickness = nt; setParameters(p); }