Examples of Algorithm


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

    params.set("dataSource", "hdfs");
    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) {
View Full Code Here

Examples of org.apache.stratos.load.balancer.conf.domain.Algorithm

                if (parameter.getNodeValue().equals("algorithmClassName")) {
                    String defaultAlgorithmName = configuration.getDefaultAlgorithmName();
                    if (StringUtils.isBlank(defaultAlgorithmName)) {
                        throw new RuntimeException("Default algorithm name not found in load balancer configuration");
                    }
                    Algorithm defaultAlgorithm = configuration.getAlgorithm(defaultAlgorithmName);
                    if (defaultAlgorithm == null) {
                        throw new RuntimeException("Default algorithm not found in load balancer configuration");
                    }
                    String algorithmClassName = defaultAlgorithm.getClassName();
                    if (log.isDebugEnabled()) {
                        log.debug(String.format("Setting algorithm-class-name = %s", algorithmClassName));
                    }
                    node.setTextContent(algorithmClassName);
                    updated = true;
View Full Code Here

Examples of org.apache.xml.security.algorithms.Algorithm

            appendSelf(transforms);
            addReturnToSelf();
        }
       
        // Create DigestMethod Element without actually instantiating a MessageDigest Object
        Algorithm digestAlgorithm = new Algorithm(getDocument(), messageDigestAlgorithm) {
            public String getBaseNamespace() {
                return Constants.SignatureSpecNS;
            }

            public String getBaseLocalName() {
                return Constants._TAG_DIGESTMETHOD;
            }
        };

        digestMethodElem = digestAlgorithm.getElement();
       
        appendSelf(digestMethodElem);
        addReturnToSelf();

        digestValueElement =
View Full Code Here

Examples of org.apache.xml.security.algorithms.Algorithm

            this.constructionElement.appendChild(transforms.getElement());
            XMLUtils.addReturnToElement(this.constructionElement);
        }
       
        // Create DigestMethod Element without actually instantiating a MessageDigest Object
        Algorithm digestAlgorithm = new Algorithm(getDocument(), messageDigestAlgorithm) {
            public String getBaseNamespace() {
                return Constants.SignatureSpecNS;
            }

            public String getBaseLocalName() {
                return Constants._TAG_DIGESTMETHOD;
            }
        };

        digestMethodElem = digestAlgorithm.getElement();
        this.constructionElement.appendChild(digestMethodElem);
        XMLUtils.addReturnToElement(this.constructionElement);
       
        digestValueElement =
            XMLUtils.createElementInSignatureSpace(this.doc, Constants._TAG_DIGESTVALUE);
View Full Code Here

Examples of org.cipres.treebase.domain.study.Algorithm

      theAnalysisStep.setAnalysis(theAnalysis);
      theAnalysis.addAnalysisStep(theAnalysisStep);
      ContextManager.getAnalysisService().save(theAnalysis);
      ContextManager.getAnalysisStepService().save(theAnalysisStep);
     
      Algorithm theAlgorithm;
      String tb1Algorithm = an.getString("algorithm");
      if (tb1Algorithm.equalsIgnoreCase("parsimony")) {
        theAlgorithm = new ParsimonyAlgorithm();
      } else if (tb1Algorithm.equalsIgnoreCase("bayesian")) {
        theAlgorithm = new BayesianAlgorithm();
      } else if (tb1Algorithm.equalsIgnoreCase("evolution")) {
        theAlgorithm = new EvolutionAlgorithm();
      } else if (tb1Algorithm.equalsIgnoreCase("joining")) {
        theAlgorithm = new JoiningAlgorithm();
      } else if (tb1Algorithm.equalsIgnoreCase("UPGMA")) {
        theAlgorithm = new UPGMAAlgorithm();
      } else if (tb1Algorithm.equalsIgnoreCase("likelihood")) {
        theAlgorithm = new LikelihoodAlgorithm();
      } else {
        theAlgorithm = new OtherAlgorithm()
      }
      theAlgorithm.setDescription(tb1Algorithm);
      ContextManager.getAlgorithmHome().save(theAlgorithm);
      theAnalysisStep.setAlgorithmInfo(theAlgorithm);
     
      { // handle INPUT_MATRIX and OUTPUT_TREE in each ANALYSIS section
        TreeBlock theTreeBlock = null;
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

    }

    AlgorithmFactory factory = (AlgorithmFactory) Activator.getContext()
        .getService(serviceReference);

    Algorithm algo = factory.createAlgorithm(inputData, parameters,
        Activator.getCiShellContext());
    if (algo instanceof ProgressTrackable) {
      ProgressTrackable pt = (ProgressTrackable) algo;
      pt.setProgressMonitor(new AlgorithmProgressMonitor());
    }
    try {

      Data[] data = algo.execute();
      return data;
    } catch (AlgorithmExecutionException e) {
      String logMessage = String.format(
          "The algorithm \"%s\" failed to execute", name,
          e.getMessage());
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

                }
            }
           
            //TODO: should parse the given hashtable since values may need to
            //be changed to different types (Vector->String[], etc...)
            Algorithm alg = factory.createAlgorithm(dm, dictionary, ciContext);
            if (alg != null) {
                algID = algReg.registerAlgorithm(alg);
            }
        }
       
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

      ProgressMonitor progressMonitor,
      Data[] data,
      Dictionary parameters,
      CIShellContext ciShellContext)
        throws AlgorithmExecutionException {
      Algorithm algorithm = algorithmFactory.createAlgorithm(data, parameters, ciShellContext);

      if ((progressMonitor != null) && (algorithm instanceof ProgressTrackable)) {
        ProgressTrackable progressTrackable = (ProgressTrackable)algorithm;
        progressTrackable.setProgressMonitor(progressMonitor);
      }

      Data[] result = algorithm.execute();

      return result;
    }
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

      ProgressMonitor progressMonitor,
      CIShellContext ciShellContext,
      LogService logger) throws AlgorithmExecutionException {
    Data[] validationData =
      new Data[] { new BasicData(file.getPath(), String.class.getName()) };
    Algorithm algorithm = validator.createAlgorithm(
      validationData, new Hashtable<String, Object>(), ciShellContext);

    if ((progressMonitor != null) && (algorithm instanceof ProgressTrackable)) {
      ProgressTrackable progressTrackable = (ProgressTrackable)algorithm;
      progressTrackable.setProgressMonitor(progressMonitor);
    }

    Data[] validatedData = algorithm.execute();

    if (validatedData != null) {
      logger.log(LogService.LOG_INFO, "Loaded: " + file.getPath());
    }
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

    /**
     * @see org.cishell.remoting.service.framework.AlgorithmRegistry#getAlgorithm(String)
     */
    public Algorithm getAlgorithm(String algorithmID) {
        Algorithm alg = (Algorithm) registry.getObject(algorithmID);
        return alg == null ? NULL_ALG : alg;
    }
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.