예제 #1
0
파일: Model.java 프로젝트: WeiWenda/YuQing
 /**
  * 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 &gt;= 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);
 }
예제 #2
0
파일: Model.java 프로젝트: WeiWenda/YuQing
 /** see {@link Linear#loadModel(java.io.Reader)} */
 public static Model load(Reader inputReader) throws IOException {
   return Linear.loadModel(inputReader);
 }
예제 #3
0
파일: Model.java 프로젝트: WeiWenda/YuQing
 /** see {@link Linear#saveModel(java.io.Writer, org.apache.lib.Model)} */
 public void save(Writer writer) throws IOException {
   Linear.saveModel(writer, this);
 }
예제 #4
0
파일: Model.java 프로젝트: WeiWenda/YuQing
 /** see {@link Linear#loadModel(java.io.File)} */
 public static Model load(String file) throws IOException {
   return Linear.loadModel(file);
 }
예제 #5
0
파일: Model.java 프로젝트: WeiWenda/YuQing
 /** see {@link Linear#saveModel(java.io.File, org.apache.lib.Model)} */
 public void save(File file) throws IOException {
   Linear.saveModel(file, this);
 }