@Override public void loadModel(BufferedReader reader) throws IOException { double globalAverage = Double.parseDouble(reader.readLine()); double[] userBiases = VectorExtensions.readVectorArray(reader); double[] itemBiases = VectorExtensions.readVectorArray(reader); reader.close(); this.globalAverage = globalAverage; this.userBiases = userBiases; this.itemBiases = itemBiases; }
@Override public void saveModel(PrintWriter writer) throws IOException { writer.println(globalAverage); VectorExtensions.writeVectorArray(writer, userBiases); VectorExtensions.writeVectorArray(writer, itemBiases); }