Package weka.clusterers

Examples of weka.clusterers.SimpleKMeans


   * default constructor
   */
  public ClassificationViaClustering() {
    super();
   
    m_Clusterer = new SimpleKMeans();
  }
View Full Code Here


   */
  public Capabilities getCapabilities() {
    Capabilities result = new Logistic().getCapabilities();
    result.or(new LinearRegression().getCapabilities());
    Capabilities classes = result.getClassCapabilities();
    result.and(new SimpleKMeans().getCapabilities());
    result.or(classes);
    return result;
  }
View Full Code Here

   
    m_standardize = new Standardize();
    m_standardize.setInputFormat(instances);
    instances = Filter.useFilter(instances, m_standardize);

    SimpleKMeans sk = new SimpleKMeans();
    sk.setNumClusters(m_numClusters);
    sk.setSeed(m_clusteringSeed);
    MakeDensityBasedClusterer dc = new MakeDensityBasedClusterer();
    dc.setClusterer(sk);
    dc.setMinStdDev(m_minStdDev);
    m_basisFilter = new ClusterMembership();
    m_basisFilter.setDensityBasedClusterer(dc);
View Full Code Here

  public ClusteringResult performClustering(Instances dataset,
      ParameterSet parameters) {

    List<Integer> clusters = new ArrayList<Integer>();
    String[] options = new String[2];
    SimpleKMeans clusterer = new SimpleKMeans();

    int numberOfGroups = parameters.getParameter(
        SimpleKMeansClustererParameters.numberOfGroups).getValue();
    options[0] = "-N";
    options[1] = String.valueOf(numberOfGroups);

    try {
      clusterer.setOptions(options);
      clusterer.buildClusterer(dataset);
      Enumeration e = dataset.enumerateInstances();
      while (e.hasMoreElements()) {
        clusters.add(clusterer.clusterInstance((Instance) e
            .nextElement()));
      }
      ClusteringResult result = new ClusteringResult(clusters, null,
          clusterer.numberOfClusters(), parameters.getParameter(
              EMClustererParameters.visualization).getValue());
      return result;

    } catch (Exception ex) {
      logger.log(Level.SEVERE, null, ex);
View Full Code Here

TOP

Related Classes of weka.clusterers.SimpleKMeans

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.