/** * The nr_feature*nr_class array w gives feature weights. We use one against the rest for * multi-class classification, so each feature index corresponds to nr_class weight values. * Weights are organized in the following way * * <pre> * +------------------+------------------+------------+ * | nr_class weights | nr_class weights | ... * | for 1st feature | for 2nd feature | * +------------------+------------------+------------+ * </pre> * * If bias >= 0, x becomes [x; bias]. The number of features is increased by one, so w is a * (nr_feature+1)*nr_class array. The value of bias is stored in the variable bias. * * @see #getBias() * @return a <b>copy of</b> the feature weight array as described */ public double[] getFeatureWeights() { return Linear.copyOf(w, w.length); }
/** see {@link Linear#loadModel(java.io.Reader)} */ public static Model load(Reader inputReader) throws IOException { return Linear.loadModel(inputReader); }
/** see {@link Linear#saveModel(java.io.Writer, org.apache.lib.Model)} */ public void save(Writer writer) throws IOException { Linear.saveModel(writer, this); }
/** see {@link Linear#loadModel(java.io.File)} */ public static Model load(String file) throws IOException { return Linear.loadModel(file); }
/** see {@link Linear#saveModel(java.io.File, org.apache.lib.Model)} */ public void save(File file) throws IOException { Linear.saveModel(file, this); }