Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeFloat()


  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);
      VectorWritable.writeVector(out, weightsPerFeature);
      VectorWritable.writeVector(out, weightsPerLabel);
      VectorWritable.writeVector(out, perlabelThetaNormalizer);
      for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) {
        VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row));
View Full Code Here


  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);
      VectorWritable.writeVector(out, weightsPerFeature);
      VectorWritable.writeVector(out, weightsPerLabel);
      VectorWritable.writeVector(out, perlabelThetaNormalizer);
      for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) {
        VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row));
View Full Code Here

      Preconditions.checkNotNull(path);

      // Write to a file the amount of PageRank mass we've seen in this reducer.
      FileSystem fs = FileSystem.get(context.getConfiguration());
      FSDataOutputStream out = fs.create(new Path(path + "/" + taskId), false);
      out.writeFloat(totalMass);
      out.close();
    }
  }

  // Mapper that distributes the missing PageRank mass (lost at the dangling nodes) and takes care
View Full Code Here

  }

  public static void writeFloat(FileSystem fs, String path, float val) {
    try {
      FSDataOutputStream out = fs.create(new Path(path), true);
      out.writeFloat(val);
      out.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      Preconditions.checkNotNull(taskId);
      Preconditions.checkNotNull(path);

      FileSystem fs = FileSystem.get(conf);
      FSDataOutputStream out = fs.create(new Path(path + "/" + taskId), false);
      out.writeFloat(totalMass);
      out.close();

      // If the HDFS node structure file is ahead, we want to emit the current node structure.
      if (hdfsAhead) {
        hdfsNode.setPageRank(Float.NEGATIVE_INFINITY);
View Full Code Here

  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);
      VectorWritable.writeVector(out, weightsPerFeature);
      VectorWritable.writeVector(out, weightsPerLabel);
      VectorWritable.writeVector(out, perlabelThetaNormalizer);
      for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) {
        VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row));
View Full Code Here

  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);
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.