Examples of DataStore


Examples of org.apache.mahout.classifier.bayes.Datastore

        throw new IllegalArgumentException(modelDir + " does not exist or is not a directory");
      }
     
      BayesParameters p = new BayesParameters();
      p.set("basePath", modelDir.getCanonicalPath());
      Datastore ds = new InMemoryBayesDatastore(p);
      Algorithm a  = new BayesAlgorithm();
      ClassifierContext ctx = new ClassifierContext(a,ds);
      ctx.initialize();
     
      //TODO: make the analyzer configurable
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.interfaces.Datastore

        return s.startsWith(".") == false;
      }
    });
   
    Algorithm algorithm;
    Datastore datastore;
   
    if (params.get("dataSource").equals("hdfs")) {
      if (params.get("classifierType").equalsIgnoreCase("bayes")) {
        log.info("Testing Bayes Classifier");
        algorithm = new BayesAlgorithm();
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.interfaces.Datastore

    String modelBasePath = (String) cmdLine.getValue(pathOpt);
   
    log.info("Loading model from: {}", params.print());
   
    Algorithm algorithm;
    Datastore datastore;
   
    String classifierType = (String) cmdLine.getValue(typeOpt);
   
    String dataSource = (String) cmdLine.getValue(dataSourceOpt);
    if (dataSource.equals("hdfs")) {
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.interfaces.Datastore

    try {
      log.info("Bayes Parameter {}", job.get("bayes.parameters"));
      Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
      log.info("{}", params.print());
      Algorithm algorithm;
      Datastore datastore;
     
      if (params.get("dataSource").equals("hdfs")) {
        if (params.get("classifierType").equalsIgnoreCase("bayes")) {
          log.info("Testing Bayes Classifier");
          algorithm = new BayesAlgorithm();
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.interfaces.Datastore

    params.set("defaultCat", "unknown");
    params.set("encoding", "UTF-8");
    params.set("alpha_i", "1.0");
   
    Algorithm algorithm = new BayesAlgorithm();
    Datastore datastore = new InMemoryBayesDatastore(params);
    ClassifierContext classifier = new ClassifierContext(algorithm, datastore);
    classifier.initialize();
    ResultAnalyzer resultAnalyzer = new ResultAnalyzer(classifier.getLabels(), params.get("defaultCat"));
   
    for (String[] entry : ClassifierData.DATA) {
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.interfaces.Datastore

    params.set("defaultCat", "unknown");
    params.set("encoding", "UTF-8");
    params.set("alpha_i", "1.0");
   
    Algorithm algorithm = new CBayesAlgorithm();
    Datastore datastore = new InMemoryBayesDatastore(params);
    ClassifierContext classifier = new ClassifierContext(algorithm, datastore);
    classifier.initialize();
    ResultAnalyzer resultAnalyzer = new ResultAnalyzer(classifier.getLabels(), params.get("defaultCat"));
    for (String[] entry : ClassifierData.DATA) {
      List<String> document = new NGrams(entry[1], Integer.parseInt(params.get("gramSize")))
View Full Code Here

Examples of org.apache.sis.storage.DataStore

         */
        if (hasUnexpectedFileCount(1, 1)) {
            return Command.INVALID_ARGUMENT_EXIT_CODE;
        }
        final Metadata metadata;
        final DataStore store = DataStores.open(files.get(0));
        try {
            metadata = store.getMetadata();
        } finally {
            store.close();
        }
        if (metadata == null) {
            return 0;
        }
        CoordinateReferenceSystem crs = null;
View Full Code Here

Examples of org.apache.wink.example.history.legacy.DataStore

     */
    @GET
    @Produces( {MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON})
    public DefectsAsset getDefects(@Context LinkBuilders linkProcessor, @Context UriInfo uriInfo) {
        // create data object (populated with store data)
        DataStore store = DataStore.getInstance();
        Collection<DefectBean> defects = store.getDefects();
        return new DefectsAsset(defects);
    }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

        "text/csv"})
    public DefectsAsset getDefects(@QueryParam(FTS) String query,
                                   @QueryParam(SEVERIIY) String severity,
                                   @QueryParam(ASSIGNED_TO) String assignedTo) {

        DataStore store = DataStore.getInstance();

        // fill search parameters
        // the parameters may be absent, the SearchMap will do the filtering
        SearchMap searchParameters = new SearchMap();
        searchParameters.put(FTS, query);
        searchParameters.put(SEVERIIY, severity);
        searchParameters.put(ASSIGNED_TO, assignedTo);

        // get the defects that match the search criteria
        Collection<DefectBean> defects = store.getDefects(searchParameters);
        return new DefectsAsset(defects);
    }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

    public Response createDefects(DefectsAsset defects,
                                  @Context LinkBuilders linkProcessor,
                                  @Context UriInfo uriInfo) {

        // add the defects to the defects store
        DataStore store = DataStore.getInstance();
        String id = null;
        for (DefectBean defect : defects.getDefects()) {
            id = store.getDefectUniqueId();
            defect.setId(id);
            store.putDefect(id, defect);
        }

        // return the created defects and set the status code to created (201)
        URI location = uriInfo.getAbsolutePathBuilder().segment(id).build();
        return Response.created(location).entity(defects).build();
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.