Package weka.core

Examples of weka.core.AttributeStats


   *
   * @param index  the index of the attribute
   */
  protected void setDerived(int index) {
   
    AttributeStats as = m_AttributeStats[index];
    long percent = Math.round(100.0 * as.missingCount / as.totalCount);
    m_MissingLab.setText("" + as.missingCount + " (" + percent + "%)");
    percent = Math.round(100.0 * as.uniqueCount / as.totalCount);
    m_UniqueLab.setText("" + as.uniqueCount + " (" + percent + "%)");
    m_DistinctLab.setText("" + as.distinctCount);
View Full Code Here


    *
    * @param inst the Instances to determine the values from which are kept 
    */
   public void determineValues(Instances inst) {
      int          i;
      AttributeStats    stats;
      int          attIdx;
      int          min;
      int          max;
      int          count;

View Full Code Here

    int removeCount = 0;
    boolean first = true;
    int maxCount = 0;
   
    for (int i=0;i<instances.numAttributes();i++) {
      AttributeStats as = instances.attributeStats(i);
      if (m_upperBoundMinSupport == 1.0 && maxCount != numInstances) {
  // see if we can decrease this by looking for the most frequent value
  int [] counts = as.nominalCounts;
  if (counts[Utils.maxIndex(counts)] > maxCount) {
    maxCount = counts[Utils.maxIndex(counts)];
View Full Code Here

      Instances toFilter = getInputFormat();
      int[] attsToDelete = new int[toFilter.numAttributes()];
      int numToDelete = 0;
      for(int i = 0; i < toFilter.numAttributes(); i++) {
  if (i==toFilter.classIndex()) continue; // skip class
  AttributeStats stats = toFilter.attributeStats(i);
  if (stats.missingCount == toFilter.numInstances()) {
    attsToDelete[numToDelete++] = i;
  } else if (stats.distinctCount < 2) {
    // remove constant attributes
    attsToDelete[numToDelete++] = i;
View Full Code Here

             boolean delete) {

      if (m_attStats == null) {
  m_attStats = new AttributeStats[m_numAttributes];
  for (int i = 0; i < m_numAttributes; i++) {
    m_attStats[i] = new AttributeStats();
    if (m_clusterInstances.attribute(i).isNominal()) {
      m_attStats[i].nominalCounts =
        new int [m_clusterInstances.attribute(i).numValues()];
    } else {
      m_attStats[i].numericStats = new Stats();
View Full Code Here

TOP

Related Classes of weka.core.AttributeStats

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.