public StoreAlphaWeight trainSvm(File saveModel) throws Exception {
  StoreAlphaWeight saww=new StoreAlphaWeight();
  this.modelFile=saveModel;
  Problem problem=new Problem();
  problem.l=train;
  problem.n=dimensions;
  problem.x=vectrain;
  problem.y=trainattr;
  SolverType s=SolverType.MCSVM_CS;
  Parameter parameter=new Parameter(s,C,eps);
  Model modelg=Linear.train(problem,parameter,saww);
  try {
    modelg.save(saveModel);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return saww;
}

public StoreAlphaWeight trainSvm ( File saveModel ) throws Exception { StoreAlphaWeight saww = new StoreAlphaWeight ( ) ; this . modelFile = saveModel ; Problem problem = new Problem ( ) ; problem . l = train ; problem . n = dimensions ; problem . x = vectrain ; problem . y = trainattr ; SolverType s = SolverType . MCSVM_CS ; Parameter parameter = new Parameter ( s , C , eps ) ; Model modelg = Linear . train ( problem , parameter , saww ) ; try { modelg . save ( saveModel ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return saww ; }
train svm model . return alpha and w matrix .
