public PerceptronModelWriter (AbstractModel model) { Object[] data = model.getDataStructures(); this.numOutcomes = model.getNumOutcomes(); PARAMS = (Context[]) data[0]; IndexHashTable<String> pmap = (IndexHashTable<String>) data[1]; OUTCOME_LABELS = (String[])data[2]; PRED_LABELS = new String[pmap.size()]; pmap.toArray(PRED_LABELS); }
public GISModelWriter(AbstractModel model) { Object[] data = model.getDataStructures(); PARAMS = (Context[]) data[0]; IndexHashTable<String> pmap = (IndexHashTable<String>) data[1]; OUTCOME_LABELS = (String[]) data[2]; CORRECTION_CONSTANT = (Integer) data[3]; CORRECTION_PARAM = (Double) data[4]; PRED_LABELS = new String[pmap.size()]; pmap.toArray(PRED_LABELS); }
public AbstractModel(Context[] params, String[] predLabels, String[] outcomeNames) { init(predLabels,outcomeNames); this.evalParams = new EvalParameters(params,outcomeNames.length); }
/** * Constructor which directly instantiates the DataInputStream containing * the model contents. * * @param dis The DataInputStream containing the model information. */ public BinaryPerceptronModelReader(DataInputStream dis) { super(new BinaryFileDataReader(dis)); }
public QNModel(String[] predNames, String[] outcomeNames, Context[] params, double[] parameters) { super(params, predNames, outcomeNames); this.prior = new UniformPrior(); this.modelType = ModelType.MaxentQn; this.parameters = parameters; }
/** * Constructor which directly instantiates the BufferedReader containing the * model contents. * * @param br * The BufferedReader containing the model information. */ public PlainTextGISModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
/** * Constructor which directly instantiates the ObjectInputStream containing * the model contents. * * @param ois The DataInputStream containing the model information. */ public ObjectGISModelReader(ObjectInputStream ois) { super(new ObjectDataReader(ois)); } }
/** * Implement as needed for the format the model is stored in. */ public String readUTF() throws java.io.IOException { return dataReader.readUTF(); }
@Override public void writeUTF(String s) throws IOException { delegateWriter.writeUTF(s); } }
public PerceptronModelWriter (AbstractModel model) { Object[] data = model.getDataStructures(); this.numOutcomes = model.getNumOutcomes(); PARAMS = (Context[]) data[0]; IndexHashTable<String> pmap = (IndexHashTable<String>) data[1]; OUTCOME_LABELS = (String[])data[2]; PRED_LABELS = new String[pmap.size()]; pmap.toArray(PRED_LABELS); }
public AbstractModel(Context[] params, String[] predLabels, String[] outcomeNames, int correctionConstant,double correctionParam) { init(predLabels,outcomeNames); this.evalParams = new EvalParameters(params,correctionParam,correctionConstant,outcomeNames.length); }
public GISModelWriter(AbstractModel model) { Object[] data = model.getDataStructures(); PARAMS = (Context[]) data[0]; IndexHashTable<String> pmap = (IndexHashTable<String>) data[1]; OUTCOME_LABELS = (String[]) data[2]; CORRECTION_CONSTANT = (Integer) data[3]; CORRECTION_PARAM = (Double) data[4]; PRED_LABELS = new String[pmap.size()]; pmap.toArray(PRED_LABELS); }
/** * Constructor which directly instantiates the BufferedReader containing * the model contents. * * @param br The BufferedReader containing the model information. */ public PlainTextPerceptronModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
/** * Constructor which directly instantiates the ObjectInputStream containing * the model contents. * * @param ois The DataInputStream containing the model information. */ public ObjectGISModelReader(ObjectInputStream ois) { super(new ObjectDataReader(ois)); } }
/** * Implement as needed for the format the model is stored in. */ public String readUTF() throws java.io.IOException { return dataReader.readUTF(); }
public AbstractModel(Context[] params, String[] predLabels, String[] outcomeNames, int correctionConstant,double correctionParam) { init(predLabels,outcomeNames); this.evalParams = new EvalParameters(params,correctionParam,correctionConstant,outcomeNames.length); }
/** * Constructor which directly instantiates the BufferedReader containing the * model contents. * * @param br * The BufferedReader containing the model information. */ public PlainTextGISModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
public AbstractModel(Context[] params, String[] predLabels, String[] outcomeNames) { init(predLabels,outcomeNames); this.evalParams = new EvalParameters(params,outcomeNames.length); }