Package org.apache.mahout.common

Examples of org.apache.mahout.common.Parameters


  }
 
  @Override
  public void configure(JobConf job) {
    try {
      Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
      if (params.get("dataSource").equals("hbase")) {
        useHbase = true;
      } else {
        return;
      }
     
View Full Code Here


  }
 
  @Override
  public void configure(JobConf job) {
    try {
      Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
      if (params.get("dataSource").equals("hbase")) {
        useHbase = true;
      } else {
        return;
      }
     
View Full Code Here

      sigmaJSigmaK = stringifier.fromString(sigmaJSigmaKString);
     
      String vocabCountString = job.get("cnaivebayes.vocabCount", stringifier.toString(vocabCount));
      vocabCount = stringifier.fromString(vocabCountString);
     
      Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
      alphaI = Double.valueOf(params.get("alpha_i", "1.0"));
     
    } catch (IOException ex) {
      log.warn(ex.toString(), ex);
    }
  }
View Full Code Here

  }
 
  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Parameters params = Parameters.fromString(context.getConfiguration().get("job.parameters", ""));
    maxTransactionLength = Integer.valueOf(params.get("maxTransactionLength", "100"));
  }
View Full Code Here

  }
 
  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Parameters params = Parameters.fromString(context.getConfiguration().get("job.parameters", ""));
    splitter = Pattern.compile(params.get("splitPattern", "[ \t]*\t[ \t]*"));
   
    int selectedFieldCount = Integer.valueOf(params.get("selectedFieldCount", "0"));
    selectedFields = new int[selectedFieldCount];
    for (int i = 0; i < selectedFieldCount; i++) {
      selectedFields[i] = Integer.valueOf(params.get("field" + i, "0"));
    }
   
    int groupingFieldCount = Integer.valueOf(params.get("groupingFieldCount", "0"));
    groupingFields = new int[groupingFieldCount];
    for (int i = 0; i < groupingFieldCount; i++) {
      groupingFields[i] = Integer.valueOf(params.get("gfield" + i, "0"));
    }
   
  }
View Full Code Here

  }
 
  @Override
  public void configure(JobConf job) {
    try {
      Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
      if (params.get("dataSource").equals("hbase")) {
        useHbase = true;
      } else {
        return;
      }
     
View Full Code Here

 
  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
   
    super.setup(context);
    Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
   
    for (Pair<String,Long> e : PFPGrowth.readFList(context.getConfiguration())) {
      featureReverseMap.add(e.getFirst());
      freqList.add(e.getSecond());
    }
   
    maxHeapSize = Integer.valueOf(params.get(PFPGrowth.MAX_HEAPSIZE, "50"));
    minSupport = Integer.valueOf(params.get(PFPGrowth.MIN_SUPPORT, "3"));

    maxPerGroup = params.getInt(PFPGrowth.MAX_PER_GROUP, 0);
    numFeatures = featureReverseMap.size();
    useFP2 = "true".equals(params.get(PFPGrowth.USE_FPG2));
  }
View Full Code Here

    int i = 0;
    for (Pair<String,Long> e : PFPGrowth.readFList(context.getConfiguration())) {
      fMap.put(e.getFirst(), i++);
    }
   
    Parameters params =
      new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));

    splitter = Pattern.compile(params.get(PFPGrowth.SPLIT_PATTERN,
                                          PFPGrowth.SPLITTER.toString()));
   
    maxPerGroup = params.getInt(PFPGrowth.MAX_PER_GROUP, 0);
  }
View Full Code Here

    if (parseArguments(args) == null) {
      return -1;
    }

    Parameters params = new Parameters();

    if (hasOption("minSupport")) {
      String minSupportString = getOption("minSupport");
      params.set("minSupport", minSupportString);
    }
    if (hasOption("maxHeapSize")) {
      String maxHeapSizeString = getOption("maxHeapSize");
      params.set("maxHeapSize", maxHeapSizeString);
    }
    if (hasOption("numGroups")) {
      String numGroupsString = getOption("numGroups");
      params.set("numGroups", numGroupsString);
    }

    if (hasOption("numTreeCacheEntries")) {
      String numTreeCacheString = getOption("numTreeCacheEntries");
      params.set("treeCacheSize", numTreeCacheString);
    }

    if (hasOption("splitterPattern")) {
      String patternString = getOption("splitterPattern");
      params.set("splitPattern", patternString);
    }

    String encoding = "UTF-8";
    if (hasOption("encoding")) {
      encoding = getOption("encoding");
    }
    params.set("encoding", encoding);

    if (hasOption("useFPG2")) {
      params.set(PFPGrowth.USE_FPG2, "true");
    }

    Path inputDir = getInputPath();
    Path outputDir = getOutputPath();

    params.set("input", inputDir.toString());
    params.set("output", outputDir.toString());

    String classificationMethod = getOption("method");
    if ("sequential".equalsIgnoreCase(classificationMethod)) {
      runFPGrowth(params);
    } else if ("mapreduce".equalsIgnoreCase(classificationMethod)) {
View Full Code Here

  }
 
  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Parameters params = new Parameters(context.getConfiguration().get("pfp.parameters", ""));
    maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50"));
   
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.common.Parameters

Copyright © 2018 www.massapicom. 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.