• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AbstractClusterer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中weka.clusterers.AbstractClusterer的典型用法代码示例。如果您正苦于以下问题:Java AbstractClusterer类的具体用法?Java AbstractClusterer怎么用?Java AbstractClusterer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AbstractClusterer类属于weka.clusterers包,在下文中一共展示了AbstractClusterer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Parses a given list of options. Valid options are:
 * <p>
 *
 * -W classname <br>
 * Specify the full class name of the clusterer to evaluate.
 * <p>
 *
 * All option after -- will be passed to the classifier.
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
@Override
public void setOptions(String[] options) throws Exception {
  m_NoSizeDetermination = Utils.getFlag("no-size", options);

  String cName = Utils.getOption('W', options);
  if (cName.length() == 0) {
    throw new Exception("A clusterer must be specified with"
      + " the -W option.");
  }
  // Do it first without options, so if an exception is thrown during
  // the option setting, listOptions will contain options for the actual
  // Classifier.
  setClusterer((DensityBasedClusterer) AbstractClusterer.forName(cName, null));
  if (getClusterer() instanceof OptionHandler) {
    ((OptionHandler) getClusterer()).setOptions(Utils
      .partitionOptions(options));
    updateOptions();
  }
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:33,代码来源:DensityBasedClustererSplitEvaluator.java


示例2: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
  * Parses a given list of options. Valid options are:<p>
  *
  * -W classname <br>
  * Specify the full class name of the clusterer to evaluate. <p>
  *
  * All option after -- will be passed to the classifier.
  *
  * @param options the list of options as an array of strings
  * @exception Exception if an option is not supported
  */
 public void setOptions(String[] options) throws Exception {
   m_NoSizeDetermination = Utils.getFlag("no-size", options);
   
   String cName = Utils.getOption('W', options);
   if (cName.length() == 0) {
     throw new Exception("A clusterer must be specified with"
		  + " the -W option.");
   }
   // Do it first without options, so if an exception is thrown during
   // the option setting, listOptions will contain options for the actual
   // Classifier.
   setClusterer((DensityBasedClusterer)AbstractClusterer.forName(cName, null));
   if (getClusterer() instanceof OptionHandler) {
     ((OptionHandler) getClusterer())
.setOptions(Utils.partitionOptions(options));
     updateOptions();
   }
 }
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:30,代码来源:DensityBasedClustererSplitEvaluator.java


示例3: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Parses a given list of options. Valid options are:
 * <p>
 * 
 * -W classname <br>
 * Specify the full class name of the clusterer to evaluate.
 * <p>
 * 
 * All option after -- will be passed to the classifier.
 * 
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
@Override
public void setOptions(String[] options) throws Exception {
  m_NoSizeDetermination = Utils.getFlag("no-size", options);

  String cName = Utils.getOption('W', options);
  if (cName.length() == 0) {
    throw new Exception("A clusterer must be specified with"
      + " the -W option.");
  }
  // Do it first without options, so if an exception is thrown during
  // the option setting, listOptions will contain options for the actual
  // Classifier.
  setClusterer((DensityBasedClusterer) AbstractClusterer.forName(cName, null));
  if (getClusterer() instanceof OptionHandler) {
    ((OptionHandler) getClusterer()).setOptions(Utils
      .partitionOptions(options));
    updateOptions();
  }
}
 
开发者ID:umple,项目名称:umple,代码行数:33,代码来源:DensityBasedClustererSplitEvaluator.java


示例4: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
  * Parses a given list of options. Valid options are:<p>
  *
  * -W classname <br>
  * Specify the full class name of the clusterer to evaluate. <p>
  *
  * All option after -- will be passed to the classifier.
  *
  * @param options the list of options as an array of strings
  * @exception Exception if an option is not supported
  */
 public void setOptions(String[] options) throws Exception {
   
   String cName = Utils.getOption('W', options);
   if (cName.length() == 0) {
     throw new Exception("A clusterer must be specified with"
		  + " the -W option.");
   }
   // Do it first without options, so if an exception is thrown during
   // the option setting, listOptions will contain options for the actual
   // Classifier.
   setClusterer((DensityBasedClusterer)AbstractClusterer.forName(cName, null));
   if (getClusterer() instanceof OptionHandler) {
     ((OptionHandler) getClusterer())
.setOptions(Utils.partitionOptions(options));
     updateOptions();
   }
 }
 
开发者ID:williamClanton,项目名称:jbossBA,代码行数:29,代码来源:DensityBasedClustererSplitEvaluator.java


示例5: createHistogram

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
private Map<Integer, Integer> createHistogram(AbstractClusterer clusterer, Instances instances) {
    Map<Integer, Integer> histogram = new TreeMap<Integer, Integer>();
    for (int i = 0; i < instances.numInstances(); i++) {
        Instance currInst = instances.instance(i);
        try {
            int cluster = clusterer.clusterInstance(currInst);

            histogram.put(cluster, histogram.containsKey(cluster) ? histogram.get(cluster) + 1 : 1);
        } catch (Exception e) {
            // Noise
            e.printStackTrace();
            histogram.put(-1, histogram.containsKey(-1) ? histogram.get(-1) + 1 : 1);

        }

    }
    return histogram;
}
 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:19,代码来源:DBScanImbalancedAlgorithm.java


示例6: createHistogram

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
public static Map<Integer, Integer> createHistogram(AbstractClusterer clusterer, Instances instances) {
    Map<Integer, Integer> histogram = new TreeMap<Integer, Integer>();
    for (int i = 0; i < instances.numInstances(); i++) {
        Instance currInst = instances.instance(i);
        try {
            int cluster = clusterer.clusterInstance(currInst);

            histogram.put(cluster, histogram.containsKey(cluster) ? histogram.get(cluster) + 1 : 1);
        } catch (Exception e) {
            // Noise
            //e.printStackTrace();
            histogram.put(-1, histogram.containsKey(-1) ? histogram.get(-1) + 1 : 1);

        }

    }
    return histogram;
}
 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:19,代码来源:ImbalancedUtils.java


示例7: createClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
     * 
     * @param trainingData
     * @param round
     * @throws Exception
     */
    protected AbstractClusterer createClusterer(MarkovAttributeSet aset, Instances trainingData) throws Exception {
        if (trace.val) LOG.trace(String.format("Clustering %d %s instances with %d attributes", trainingData.numInstances(), CatalogUtil.getDisplayName(catalog_proc), aset.size()));
        
        // Create the filter we need so that we only include the attributes in the given MarkovAttributeSet
        Filter filter = aset.createFilter(trainingData);
        
        // Using our training set to build the clusterer
        int seed = this.rand.nextInt(); 
//        SimpleKMeans inner_clusterer = new SimpleKMeans();
        EM inner_clusterer = new EM();
        String options[] = {
            "-N", Integer.toString(1000), // num_partitions),
            "-S", Integer.toString(seed),
            "-I", Integer.toString(100),
            
        };
        inner_clusterer.setOptions(options);
        
        FilteredClusterer filtered_clusterer = new FilteredClusterer();
        filtered_clusterer.setFilter(filter);
        filtered_clusterer.setClusterer(inner_clusterer);
        
        AbstractClusterer clusterer = filtered_clusterer;
        clusterer.buildClusterer(trainingData);
        
        return (clusterer);
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:34,代码来源:FeatureClusterer.java


示例8: init

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
public void init(AbstractClusterer clusterer) {
    this.clusterer = clusterer;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:4,代码来源:FeatureClusterer.java


示例9: generateDecisionTree

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
protected Classifier generateDecisionTree(AbstractClusterer clusterer, MarkovAttributeSet aset, Instances data) throws Exception {
    // We need to create a new Attribute that has the ClusterId
    Instances newData = data; // new Instances(data);
    newData.insertAttributeAt(new Attribute("ClusterId"), newData.numAttributes());
    Attribute cluster_attr = newData.attribute(newData.numAttributes()-1);
    assert(cluster_attr != null);
    assert(cluster_attr.index() > 0);
    newData.setClass(cluster_attr);
    
    // We will then tell the Classifier to predict that ClusterId based on the MarkovAttributeSet
    ObjectHistogram<Integer> cluster_h = new ObjectHistogram<Integer>();
    for (int i = 0, cnt = newData.numInstances(); i < cnt; i++) {
        // Grab the Instance and throw it at the the clusterer to get the target cluster
        Instance inst = newData.instance(i);
        int c = (int)clusterer.clusterInstance(inst);
        inst.setClassValue(c);
        cluster_h.put(c);
    } // FOR
    System.err.println("Number of Elements: " + cluster_h.getValueCount());
    System.err.println(cluster_h);

    NumericToNominal filter = new NumericToNominal();
    filter.setInputFormat(newData);
    newData = Filter.useFilter(newData, filter);
    
    String output = this.catalog_proc.getName() + "-labeled.arff";
    FileUtil.writeStringToFile(output, newData.toString());
    LOG.info("Wrote labeled data set to " + output);
    
    // Decision Tree
    J48 j48 = new J48();
    String options[] = {
        "-S", Integer.toString(this.rand.nextInt()),
        
    };
    j48.setOptions(options);

    // Make sure we add the ClusterId attribute to a new MarkovAttributeSet so that
    // we can tell the Classifier to classify that!
    FilteredClassifier fc = new FilteredClassifier();
    MarkovAttributeSet classifier_aset = new MarkovAttributeSet(aset);
    classifier_aset.add(cluster_attr);
    fc.setFilter(classifier_aset.createFilter(newData));
    fc.setClassifier(j48);
    
    // Bombs away!
    fc.buildClassifier(newData);
    
    return (fc);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:51,代码来源:FeatureClusterer.java


示例10: testCreateClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
     * testCreateClusterer
     */
    @Test
    public void testCreateClusterer() throws Exception {
        // Construct a simple MarkovAttributeSet that only contains the BasePartitionFeature
        MarkovAttributeSet base_aset = new MarkovAttributeSet(data, FeatureUtil.getFeatureKeyPrefix(BasePartitionFeature.class));
        assertFalse(base_aset.isEmpty());
        int base_partition_idx = CollectionUtil.first(base_aset).index();
        
        AbstractClusterer clusterer = this.fclusterer.createClusterer(base_aset, data);
        assertNotNull(clusterer);
        
        // Make sure that each Txn gets mapped to the same cluster as its base partition
        Map<Integer, Histogram<Integer>> p_c_xref = new HashMap<Integer, Histogram<Integer>>();
        for (int i = 0, cnt = data.numInstances(); i < cnt; i++) {
            Instance inst = data.instance(i);
            assertNotNull(inst);
            long txn_id = FeatureUtil.getTransactionId(inst);

            TransactionTrace txn_trace = workload.getTransaction(txn_id);
            assertNotNull(txn_trace);
            Integer base_partition = p_estimator.getBasePartition(txn_trace);
            assertNotNull(base_partition);
            assertEquals(base_partition.intValue(), (int)inst.value(base_partition_idx));

            int c = clusterer.clusterInstance(inst);
            Histogram<Integer> h = p_c_xref.get(base_partition);
            if (h == null) {
                h = new ObjectHistogram<Integer>();
                p_c_xref.put(base_partition, h);
            }
            h.put(c);
        } // FOR
        
//        System.err.println(StringUtil.formatMaps(p_c_xref));
//        Set<Integer> c_p_xref = new HashSet<Integer>();
//        for (Entry<Integer, Histogram> e : p_c_xref.entrySet()) {
//            Set<Integer> clusters = e.getValue().values();
//            
//            // Make sure that each base partition is only mapped to one cluster
//            assertEquals(e.getKey().toString(), 1, clusters.size());
//            
//            // Make sure that two different base partitions are not mapped to the same cluster
//            assertFalse(c_p_xref.contains(CollectionUtil.getFirst(clusters)));
//            c_p_xref.addAll(clusters);
//        } // FOR
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:49,代码来源:TestFeatureClusterer.java


示例11: batchFinished

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Signify that this batch of input to the filter is finished.
 * 
 * @return true if there are instances pending output
 * @throws IllegalStateException if no input structure has been defined
 */
@Override
public boolean batchFinished() throws Exception {
  if (getInputFormat() == null) {
    throw new IllegalStateException("No input instance format defined");
  }

  Instances toFilter = getInputFormat();

  if (!isFirstBatchDone()) {
    // filter out attributes if necessary
    Instances toFilterIgnoringAttributes = removeIgnored(toFilter);

    // serialized model or build clusterer from scratch?
    File file = getSerializedClustererFile();
    if (!file.isDirectory()) {
      ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
      m_ActualClusterer = (Clusterer) ois.readObject();
      Instances header = null;
      // let's see whether there's an Instances header stored as well
      try {
        header = (Instances) ois.readObject();
      } catch (Exception e) {
        // ignored
      }
      ois.close();
      // same dataset format?
      if ((header != null)
        && (!header.equalHeaders(toFilterIgnoringAttributes))) {
        throw new WekaException(
          "Training header of clusterer and filter dataset don't match:\n"
            + header.equalHeadersMsg(toFilterIgnoringAttributes));
      }
    } else {
      m_ActualClusterer = AbstractClusterer.makeCopy(m_Clusterer);
      m_ActualClusterer.buildClusterer(toFilterIgnoringAttributes);
    }

    // create output dataset with new attribute
    Instances filtered = new Instances(toFilter, 0);
    ArrayList<String> nominal_values = new ArrayList<String>(
      m_ActualClusterer.numberOfClusters());
    for (int i = 0; i < m_ActualClusterer.numberOfClusters(); i++) {
      nominal_values.add("cluster" + (i + 1));
    }
    filtered.insertAttributeAt(new Attribute("cluster", nominal_values),
      filtered.numAttributes());

    setOutputFormat(filtered);
  }

  // build new dataset
  for (int i = 0; i < toFilter.numInstances(); i++) {
    convertInstance(toFilter.instance(i));
  }

  flushInput();
  m_NewBatch = true;
  m_FirstBatchDone = true;

  return (numPendingOutput() != 0);
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:68,代码来源:AddCluster.java


示例12: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Parses a given list of options.
 * <p/>
 * 
 * <!-- options-start --> Valid options are:
 * <p/>
 * 
 * <pre>
 * -W &lt;clusterer specification&gt;
 *  Full class name of clusterer to use, followed
 *  by scheme options. eg:
 *   "weka.clusterers.SimpleKMeans -N 3"
 *  (default: weka.clusterers.SimpleKMeans)
 * </pre>
 * 
 * <pre>
 * -serialized &lt;file&gt;
 *  Instead of building a clusterer on the data, one can also provide
 *  a serialized model and use that for adding the clusters.
 * </pre>
 * 
 * <pre>
 * -I &lt;att1,att2-att4,...&gt;
 *  The range of attributes the clusterer should ignore.
 * </pre>
 * 
 * <!-- options-end -->
 * 
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
@Override
public void setOptions(String[] options) throws Exception {
  String tmpStr;
  String[] tmpOptions;
  File file;
  boolean serializedModel;

  serializedModel = false;
  tmpStr = Utils.getOption("serialized", options);
  if (tmpStr.length() != 0) {
    file = new File(tmpStr);
    if (!file.exists()) {
      throw new FileNotFoundException("File '" + file.getAbsolutePath()
        + "' not found!");
    }
    if (file.isDirectory()) {
      throw new FileNotFoundException("'" + file.getAbsolutePath()
        + "' points to a directory not a file!");
    }
    setSerializedClustererFile(file);
    serializedModel = true;
  } else {
    setSerializedClustererFile(null);
  }

  if (!serializedModel) {
    tmpStr = Utils.getOption('W', options);
    if (tmpStr.length() == 0) {
      tmpStr = weka.clusterers.SimpleKMeans.class.getName();
    }
    tmpOptions = Utils.splitOptions(tmpStr);
    if (tmpOptions.length == 0) {
      throw new Exception("Invalid clusterer specification string");
    }
    tmpStr = tmpOptions[0];
    tmpOptions[0] = "";
    setClusterer(AbstractClusterer.forName(tmpStr, tmpOptions));
  }

  setIgnoredAttributeIndices(Utils.getOption('I', options));

  Utils.checkForRemainingOptions(options);
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:75,代码来源:AddCluster.java


示例13: batchFinished

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
  * Signify that this batch of input to the filter is finished.
  *
  * @return true if there are instances pending output
  * @throws IllegalStateException if no input structure has been defined 
  */  
 public boolean batchFinished() throws Exception {
   if (getInputFormat() == null)
     throw new IllegalStateException("No input instance format defined");

   Instances toFilter = getInputFormat();
   
   if (!isFirstBatchDone()) {
     // filter out attributes if necessary
     Instances toFilterIgnoringAttributes = removeIgnored(toFilter);

     // serialized model or build clusterer from scratch?
     File file = getSerializedClustererFile();
     if (!file.isDirectory()) {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
m_ActualClusterer = (Clusterer) ois.readObject();
Instances header = null;
// let's see whether there's an Instances header stored as well
try {
  header = (Instances) ois.readObject();
}
catch (Exception e) {
  // ignored
}
ois.close();
// same dataset format?
if ((header != null) && (!header.equalHeaders(toFilterIgnoringAttributes)))
  throw new WekaException(
      "Training header of clusterer and filter dataset don't match:\n"
      + header.equalHeadersMsg(toFilterIgnoringAttributes));
     }
     else {
m_ActualClusterer = AbstractClusterer.makeCopy(m_Clusterer);
m_ActualClusterer.buildClusterer(toFilterIgnoringAttributes);
     }

     // create output dataset with new attribute
     Instances filtered = new Instances(toFilter, 0); 
     FastVector nominal_values = new FastVector(m_ActualClusterer.numberOfClusters());
     for (int i = 0; i < m_ActualClusterer.numberOfClusters(); i++) {
nominal_values.addElement("cluster" + (i+1)); 
     }
     filtered.insertAttributeAt(new Attribute("cluster", nominal_values),
  filtered.numAttributes());

     setOutputFormat(filtered);
   }

   // build new dataset
   for (int i=0; i<toFilter.numInstances(); i++) {
     convertInstance(toFilter.instance(i));
   }
   
   flushInput();
   m_NewBatch = true;
   m_FirstBatchDone = true;

   return (numPendingOutput() != 0);
 }
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:65,代码来源:AddCluster.java


示例14: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
  * Parses a given list of options. <p/>
  * 
  <!-- options-start -->
  * Valid options are: <p/>
  * 
  * <pre> -W &lt;clusterer specification&gt;
  *  Full class name of clusterer to use, followed
  *  by scheme options. eg:
  *   "weka.clusterers.SimpleKMeans -N 3"
  *  (default: weka.clusterers.SimpleKMeans)</pre>
  * 
  * <pre> -serialized &lt;file&gt;
  *  Instead of building a clusterer on the data, one can also provide
  *  a serialized model and use that for adding the clusters.</pre>
  * 
  * <pre> -I &lt;att1,att2-att4,...&gt;
  *  The range of attributes the clusterer should ignore.
  * </pre>
  * 
  <!-- options-end -->
  *
  * @param options the list of options as an array of strings
  * @throws Exception if an option is not supported
  */
 public void setOptions(String[] options) throws Exception {
   String	tmpStr;
   String[] 	tmpOptions;
   File	file;
   boolean 	serializedModel;
   
   serializedModel = false;
   tmpStr = Utils.getOption("serialized", options);
   if (tmpStr.length() != 0) {
     file = new File(tmpStr);
     if (!file.exists())
throw new FileNotFoundException(
    "File '" + file.getAbsolutePath() + "' not found!");
     if (file.isDirectory())
throw new FileNotFoundException(
    "'" + file.getAbsolutePath() + "' points to a directory not a file!");
     setSerializedClustererFile(file);
     serializedModel = true;
   }
   else {
     setSerializedClustererFile(null);
   }

   if (!serializedModel) {
     tmpStr = Utils.getOption('W', options);
     if (tmpStr.length() == 0)
tmpStr = weka.clusterers.SimpleKMeans.class.getName();
     tmpOptions = Utils.splitOptions(tmpStr);
     if (tmpOptions.length == 0) {
throw new Exception("Invalid clusterer specification string");
     }
     tmpStr = tmpOptions[0];
     tmpOptions[0] = "";
     setClusterer(AbstractClusterer.forName(tmpStr, tmpOptions));
   }
       
   setIgnoredAttributeIndices(Utils.getOption('I', options));

   Utils.checkForRemainingOptions(options);
 }
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:66,代码来源:AddCluster.java


示例15: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Parses the options for this object. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  If set, classifier is run in debug mode and
 *  may output additional info to the console</pre>
 * 
 * <pre> -W
 *  Full name of clusterer.
 *  (default: weka.clusterers.SimpleKMeans)</pre>
 * 
 * <pre> 
 * Options specific to clusterer weka.clusterers.SimpleKMeans:
 * </pre>
 * 
 * <pre> -N &lt;num&gt;
 *  number of clusters.
 *  (default 2).</pre>
 * 
 * <pre> -V
 *  Display std. deviations for centroids.
 * </pre>
 * 
 * <pre> -M
 *  Replace missing values with mean/mode.
 * </pre>
 * 
 * <pre> -S &lt;num&gt;
 *  Random number seed.
 *  (default 10)</pre>
 * 
 <!-- options-end -->
 *
 * @param options	the options to use
 * @throws Exception	if setting of options fails
 */
public void setOptions(String[] options) throws Exception {
  String	tmpStr;

  super.setOptions(options);

  tmpStr = Utils.getOption('W', options);
  if (tmpStr.length() > 0) { 
    // This is just to set the classifier in case the option 
    // parsing fails.
    setClusterer(AbstractClusterer.forName(tmpStr, null));
    setClusterer(AbstractClusterer.forName(tmpStr, Utils.partitionOptions(options)));
  }
  else {
    // This is just to set the classifier in case the option 
    // parsing fails.
    setClusterer(AbstractClusterer.forName(defaultClustererString(), null));
    setClusterer(AbstractClusterer.forName(defaultClustererString(), Utils.partitionOptions(options)));
  }
}
 
开发者ID:williamClanton,项目名称:jbossBA,代码行数:59,代码来源:ClassificationViaClustering.java


示例16: setOptions

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -W &lt;clusterer specification&gt;
 *  Full class name of clusterer to use, followed
 *  by scheme options. eg:
 *   "weka.clusterers.SimpleKMeans -N 3"
 *  (default: weka.clusterers.SimpleKMeans)</pre>
 * 
 * <pre> -I &lt;att1,att2-att4,...&gt;
 *  The range of attributes the clusterer should ignore.
 * </pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {

  String clustererString = Utils.getOption('W', options);
  if (clustererString.length() == 0)
    clustererString = weka.clusterers.SimpleKMeans.class.getName();
  String[] clustererSpec = Utils.splitOptions(clustererString);
  if (clustererSpec.length == 0) {
    throw new Exception("Invalid clusterer specification string");
  }
  String clustererName = clustererSpec[0];
  clustererSpec[0] = "";
  setClusterer(AbstractClusterer.forName(clustererName, clustererSpec));
      
  setIgnoredAttributeIndices(Utils.getOption('I', options));

  Utils.checkForRemainingOptions(options);
}
 
开发者ID:williamClanton,项目名称:jbossBA,代码行数:39,代码来源:AddCluster.java


示例17: setClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
@Override
public void setClusterer(AbstractClusterer clusteringAlgorithm) {
    this.clusterer = clusteringAlgorithm;

}
 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:6,代码来源:DBScanImbalancedAlgorithm.java


示例18: setClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
public void setClusterer(AbstractClusterer clusterer) {
    this.clusterer = clusterer;
}
 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:4,代码来源:ImbalancedClassifier.java


示例19: setClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
@Override
public void setClusterer(AbstractClusterer clusteringAlgorithm) {


    this.clusterer = clusteringAlgorithm;

}
 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:8,代码来源:ClusterImbalancedAlgorithm.java


示例20: setClusterer

import weka.clusterers.AbstractClusterer; //导入依赖的package包/类
public void setClusterer(AbstractClusterer clusteringAlgorithm); 
开发者ID:kokojumbo,项目名称:master-thesis,代码行数:2,代码来源:ImbalancedAlgorithm.java



注:本文中的weka.clusterers.AbstractClusterer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DateUtils类代码示例发布时间:2022-05-22
下一篇:
Java Resource类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap