out.close();
}
static public AbstractModel getModel(AbstractTrainSpace space, byte solver, double alpha, double rho, double eps)
{
AbstractAdaGrad algorithm = null;
switch (solver)
{
case AbstractAlgorithm.SOLVER_ADAGRAD_HINGE:
algorithm = new AdaGradHinge(alpha, rho, eps); break;
case AbstractAlgorithm.SOLVER_ADAGRAD_LR:
algorithm = new AdaGradLR(alpha, rho, eps); break;
}
AbstractModel model = space.getModel();
model.initWeightVector();
algorithm.train(space);
return model;
}