public static <L, F> LinearClassifier<L, F> readClassifier(String loadPath) {
    System.err.print("Deserializing classifier from " + loadPath + "...");

    try {
      ObjectInputStream ois = IOUtils.readStreamFromString(loadPath);
      LinearClassifier<L, F> classifier = ErasureUtils.<LinearClassifier<L, F>>uncheckedCast(ois.readObject());
      ois.close();
      return classifier;
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException("Deserialization failed: "+e.getMessage());
    }
  }
public static < L , F > LinearClassifier < L , F > readClassifier ( String loadPath ) { System . err . print ( "Deserializing classifier from " + loadPath + "..." ) ; try { ObjectInputStream ois = IOUtils . readStreamFromString ( loadPath ) ; LinearClassifier < L , F > classifier = ErasureUtils . < LinearClassifier < L , F > > uncheckedCast ( ois . readObject ( ) ) ; ois . close ( ) ; return classifier ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new RuntimeException ( "Deserialization failed: " + e . getMessage ( ) ) ; } }
Loads a classifier from a file.
Simple convenience wrapper for IOUtils.readFromString.