List of usage examples for org.apache.mahout.classifier.sgd PolymorphicWritable read
public static <T extends Writable> T read(DataInput dataInput, Class<? extends T> clazz) throws IOException
From source file:com.cloudera.knittingboar.sgd.ParallelOnlineLogisticRegression.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { int version = in.readInt(); if (version == WRITABLE_VERSION) { learningRate = in.readDouble();/*from w w w. j a v a2 s . co m*/ decayFactor = in.readDouble(); stepOffset = in.readInt(); step = in.readInt(); forgettingExponent = in.readDouble(); perTermAnnealingOffset = in.readInt(); numCategories = in.readInt(); beta = MatrixWritable.readMatrix(in); prior = PolymorphicWritable.read(in, PriorFunction.class); updateCounts = VectorWritable.readVector(in); updateSteps = VectorWritable.readVector(in); } else { throw new IOException("Incorrect object version, wanted " + WRITABLE_VERSION + " got " + version); } }