Package org.apache.mahout.math

Examples of org.apache.mahout.math.VectorWritable.readFields()


  }
 
  @Override
  public void readFields(DataInput in) throws IOException {
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    coefficients = temp.get();
  }
 
  @Override
  public void write(DataOutput out) throws IOException {
View Full Code Here


  @Override
  public void readFields(DataInput in) throws IOException {
    this.setId(in.readInt());
    converged = in.readBoolean();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.setCenter(new RandomAccessSparseVector(temp.get()));
    this.pointProbSum = 0;
    this.weightedPointTotal = getCenter().like();
  }
 
View Full Code Here

        if (!fs.exists(meanVectorFile.get())) {
          throw new FileNotFoundException(meanVectorFile.get().toString());
        }
        DataInputStream in = fs.open(meanVectorFile.get());
        try {
          meanVector.readFields(in);
        } finally {
          in.close();
        }
        this.meanVector = meanVector.get();
      }
View Full Code Here

        if (!fs.exists(weightsFile.get())) {
          throw new FileNotFoundException(weightsFile.get().toString());
        }
        DataInputStream in = fs.open(weightsFile.get());
        try {
          weights.readFields(in);
        } finally {
          in.close();
        }
        this.weights = weights.get();
      }
View Full Code Here

  @Override
  public void readFields(DataInput in) throws IOException {
    this.combinerState = in.readInt();
    this.s0 = in.readDouble();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.s1 = temp.get();
    temp.readFields(in);
    this.s2 = temp.get();
  }
View Full Code Here

    this.combinerState = in.readInt();
    this.s0 = in.readDouble();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.s1 = temp.get();
    temp.readFields(in);
    this.s2 = temp.get();
  }

  @Override
  public void write(DataOutput out) throws IOException {
View Full Code Here

  @Override
  public void readFields(DataInput in) throws IOException {
    this.id = in.readInt();
    this.numPoints = in.readInt();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.center = temp.get();
    temp.readFields(in);
    this.radius = temp.get();
  }
View Full Code Here

    this.id = in.readInt();
    this.numPoints = in.readInt();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.center = temp.get();
    temp.readFields(in);
    this.radius = temp.get();
  }

  @Override
  public void write(DataOutput out) throws IOException {
View Full Code Here

  @Override
  public void readFields(DataInput in) throws IOException {
    boolean hasVector = in.readBoolean();
    if (hasVector) {
      VectorWritable writable = new VectorWritable();
      writable.readFields(in);
      set(writable.get());
    } else {
      long theUserID = Varint.readSignedVarLong(in);
      float theValue = in.readFloat();
      set(theUserID, theValue);
View Full Code Here

  }

  @Override
  public void readFields(DataInput in) throws IOException {
    VectorWritable writable = new VectorWritable();
    writable.readFields(in);
    vector = writable.get();
    int size = Varint.readUnsignedVarInt(in);
    userIDs = new ArrayList<Long>(size);
    values = new ArrayList<Float>(size);
    for (int i = 0; i < size; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.