public void serialize(Path output, Configuration conf) throws IOException {
FileSystem fs = output.getFileSystem(conf);
FSDataOutputStream out = fs.create(new Path(output, "naiveBayesModel.bin"));
try {
out.writeFloat(alphaI);
out.writeBoolean(isComplementary);
VectorWritable.writeVector(out, weightsPerFeature);
VectorWritable.writeVector(out, weightsPerLabel);
if (isComplementary){
VectorWritable.writeVector(out, perlabelThetaNormalizer);
}