title: Save and load SMO weka model from file
body: <p>I am using Weka SMO to classify my training data and I want to save and load easily to/from file my SMO model. I have created a save method in order to store Classifier to file. My code is the following:</p>
  
  <pre><code>private static Classifier loadModel(Classifier c, String name, File path) throws Exception {
  
    FileInputStream fis = new FileInputStream("/weka_models/" + name + ".model");
    ObjectInputStream ois = new ObjectInputStream(fis);             
  
  return c;
  }
  
  private static void saveModel(Classifier c, String name, File path) throws Exception {
  
  
      ObjectOutputStream oos = null;
      try {
          oos = new ObjectOutputStream(
                  new FileOutputStream("/weka_models/" + name + ".model"));
  
      } catch (FileNotFoundException e1) {
          e1.printStackTrace();
      } catch (IOException e1) {
          e1.printStackTrace();
      }
      oos.writeObject(c);
      oos.flush();
      oos.close();
  
  }
  </code></pre>
  
  <p>My problem is, how to convert ObjectInputStream  to Classifier object.</p>