/* Copyright (C) 2002 Univ. of Massachusetts Amherst, Computer Science Dept.
This file is part of "MALLET" (MAchine Learning for LanguagE Toolkit).
http://www.cs.umass.edu/~mccallum/mallet
This software is provided under the terms of the Common Public License,
version 1.0, as published by http://www.opensource.org. For further
information, see the file `LICENSE' included with this distribution. */
/**
@author Aron Culotta culotta@cs.umass.edu
*/
package cc.mallet.classify;
import cc.mallet.pipe.Pipe;
import cc.mallet.types.FeatureVector;
import cc.mallet.types.Instance;
import cc.mallet.types.LabelVector;
/**
* Classification methods of Winnow2 algorithm.
* @see WinnowTrainer
*/
public class Winnow extends Classifier{
/**
*array of weights, one for each feature, initialized to 1
*/
double [][] weights;
/**
*threshold for sum of wi*xi in formulating guess
*/
double theta;
/**
* Passes along data pipe and weights from
* {@link #WinnowTrainer WinnowTrainer}
* @param dataPipe needed for dictionary, labels, feature vectors, etc
* @param newWeights weights calculated during training phase
* @param theta value used for threshold
* @param idim i dimension of weights array
* @param jdim j dimension of weights array
*/
public Winnow (Pipe dataPipe,
double [][]newWeights, double theta,
int idim, int jdim){
super (dataPipe);
this.theta = theta;
this.weights = new double[idim][jdim];
for(int i=0; i
Ads help maintain this website.