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;

      HBconf.set(new HBaseConfiguration(job));
View Full Code Here


        String vocabCountString = stringifier.toString(vocabCount);
        vocabCountString = job.get("cnaivebayes.vocabCount", vocabCountString);
        vocabCount = stringifier.fromString(vocabCountString);
       
        Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
        alpha_i = Double.valueOf(params.get("alpha_i", "1.0"));

      }
    } catch (IOException ex) {
      log.warn(ex.toString(), ex);
    }
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;

      HBaseConfiguration HBconf = new HBaseConfiguration(job);
View Full Code Here

  @Override
  protected void setup(Context context) throws IOException,
      InterruptedException {
    super.setup(context);
    Parameters params = Parameters.fromString(context.getConfiguration().get(
        "pfp.parameters", ""));
    splitter = Pattern.compile(params.get("splitPattern", PFPGrowth.SPLITTER
        .toString()));
  }
View Full Code Here

  @Override
  protected void setup(Context context) throws IOException, InterruptedException {

    super.setup(context);
    Parameters params = Parameters.fromString(context.getConfiguration().get(
        "pfp.parameters", ""));
   
   
   
    int i = 0;
    for(Pair<String, Long> e: PFPGrowth.deserializeList(params, "fList", context
        .getConfiguration()))
    {
      featureReverseMap.add(e.getFirst());
      fMap.put(e.getFirst(), i);
      fList.add(new Pair<Integer, Long>(i++, e.getSecond()));
    }
   
    Map<String, Long> gList = PFPGrowth.deserializeMap(params, "gList", context
        .getConfiguration());
   
    for (Entry<String, Long> entry : gList.entrySet()) {
      List<Integer> groupList = groupFeatures.get(entry.getValue());
      Integer itemInteger = fMap.get(entry.getKey());
      if (groupList != null)
        groupList.add(itemInteger);
      else {
        groupList = new ArrayList<Integer>();
        groupList.add(itemInteger);
        groupFeatures.put(entry.getValue(), groupList);
      }

    }
    maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50"));
    minSupport = Integer.valueOf(params.get("minSupport", "3"));
    FPTreeDepthCache.setFirstLevelCacheSize(Integer.valueOf(params
        .get("treeCacheSize", Integer
            .toString(FPTreeDepthCache.getFirstLevelCacheSize()))));
  }
View Full Code Here

  @Override
  protected void setup(Context context) throws IOException,
      InterruptedException {
    super.setup(context);
    Parameters params = Parameters.fromString(context.getConfiguration().get(
        "pfp.parameters", ""));

    int i = 0;
    for (Pair<String, Long> e : PFPGrowth.deserializeList(params, "fList",
        context.getConfiguration())) {
      fMap.put(e.getFirst(), i++);
    }
   
    for (Entry<String, Long> e : PFPGrowth.deserializeMap(params, "gList",
        context.getConfiguration()).entrySet()) {
      gListInt.put(fMap.get(e.getKey()), e.getValue());
    }
    splitter = Pattern.compile(params.get("splitPattern", PFPGrowth.SPLITTER
        .toString()));

  }
View Full Code Here

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

  }
View Full Code Here

  }
 
  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Parameters params = new Parameters(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 = new Parameters(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

     
      String vocabCountString = stringifier.toString(vocabCount);
      vocabCountString = job.get("cnaivebayes.vocabCount", vocabCountString);
      vocabCount = stringifier.fromString(vocabCountString);
     
      Parameters params = new Parameters(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

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.