public static void writeBinary(String path, AdaptiveLogisticRegression model) throws IOException { DataOutputStream out = new DataOutputStream(new FileOutputStream(path)); try { PolymorphicWritable.write(out, model); } finally { Closeables.closeQuietly(out); } }
public static void writeBinary(String path, CrossFoldLearner model) throws IOException { DataOutputStream out = new DataOutputStream(new FileOutputStream(path)); try { PolymorphicWritable.write(out, model); } finally { Closeables.closeQuietly(out); } }
public static <T extends Writable> T readBinary(InputStream in, Class<T> clazz) throws IOException { DataInputStream dataIn = new DataInputStream(in); try { return PolymorphicWritable.read(dataIn, clazz); } finally { Closeables.closeQuietly(in); } }