Java 类weka.core.converters.IncrementalConverter 实例源码

项目:repo.kmeanspp.silhouette_score    文件:SetInstancesPanel.java   
/**
 * Loads results from a set of instances contained in the supplied file.
 * 
 * @param f a value of type 'File'
 */
protected void setInstancesFromFile(File f) {
  boolean incremental = m_readIncrementally;

  try {
    // m_Loader = ConverterUtils.getLoaderForFile(f);
    m_Loader = m_FileChooser.getLoader();
    if (m_Loader == null)
      throw new Exception(
          "No suitable FileSourcedConverter found for file!\n" + f);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((FileSourcedConverter) m_Loader).setFile(f);
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      // If we are batch loading then we will know for sure that
      // the data has no instances
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this,
        "Couldn't read from file:\n" + f.getName(), "Load Instances",
        JOptionPane.ERROR_MESSAGE);
  }
}
项目:repo.kmeanspp.silhouette_score    文件:SetInstancesPanel.java   
/**
 * Loads instances from a URL.
 * 
 * @param u the URL to load from.
 */
protected void setInstancesFromURL(URL u) {
  boolean incremental = m_readIncrementally;

  try {
    m_Loader = ConverterUtils.getURLLoaderForFile(u.toString());
    if (m_Loader == null)
      throw new Exception("No suitable URLSourcedLoader found for URL!\n" + u);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((URLSourcedLoader) m_Loader).setURL(u.toString());
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this, "Couldn't read from URL:\n" + u,
        "Load Instances", JOptionPane.ERROR_MESSAGE);
  }
}
项目:autoweka    文件:SetInstancesPanel.java   
/**
  * Loads results from a set of instances contained in the supplied
  * file.
  *
  * @param f a value of type 'File'
  */
 protected void setInstancesFromFile(File f) {
   boolean incremental = m_readIncrementally;

   try {
     m_Loader = ConverterUtils.getLoaderForFile(f);
     if (m_Loader == null)
throw new Exception("No suitable FileSourcedConverter found for file!\n" + f);

     // not an incremental loader?
     if (!(m_Loader instanceof IncrementalConverter))
incremental = false;

     // load
     ((FileSourcedConverter) m_Loader).setFile(f);
     if (incremental) {
       m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
setInstances(m_Loader.getStructure());
     } else {
       // If we are batch loading then we will know for sure that
       // the data has no instances
       m_Summary.setShowZeroInstancesAsUnknown(false);
setInstances(m_Loader.getDataSet());
     }
   } catch (Exception ex) {
     JOptionPane.showMessageDialog(this,
                "Couldn't read from file:\n"
                + f.getName(),
                "Load Instances",
                JOptionPane.ERROR_MESSAGE);
   }
 }
项目:autoweka    文件:SetInstancesPanel.java   
/**
  * Loads instances from a URL.
  *
  * @param u the URL to load from.
  */
 protected void setInstancesFromURL(URL u) {
   boolean incremental = m_readIncrementally;

   try {
     m_Loader = ConverterUtils.getURLLoaderForFile(u.toString());
     if (m_Loader == null)
throw new Exception("No suitable URLSourcedLoader found for URL!\n" + u);

     // not an incremental loader?
     if (!(m_Loader instanceof IncrementalConverter))
incremental = false;

     // load
     ((URLSourcedLoader) m_Loader).setURL(u.toString());
     if (incremental) {
       m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
setInstances(m_Loader.getStructure());
     } else {
       m_Summary.setShowZeroInstancesAsUnknown(false);
setInstances(m_Loader.getDataSet());
     }
   } catch (Exception ex) {
     JOptionPane.showMessageDialog(this,
                "Couldn't read from URL:\n"
                + u,
                "Load Instances",
                JOptionPane.ERROR_MESSAGE);
   }
 }
项目:umple    文件:SetInstancesPanel.java   
/**
 * Loads results from a set of instances contained in the supplied file.
 * 
 * @param f a value of type 'File'
 */
protected void setInstancesFromFile(File f) {
  boolean incremental = m_readIncrementally;

  try {
    // m_Loader = ConverterUtils.getLoaderForFile(f);
    m_Loader = m_FileChooser.getLoader();
    if (m_Loader == null)
      throw new Exception(
          "No suitable FileSourcedConverter found for file!\n" + f);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((FileSourcedConverter) m_Loader).setFile(f);
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      // If we are batch loading then we will know for sure that
      // the data has no instances
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this,
        "Couldn't read from file:\n" + f.getName(), "Load Instances",
        JOptionPane.ERROR_MESSAGE);
  }
}
项目:umple    文件:SetInstancesPanel.java   
/**
 * Loads instances from a URL.
 * 
 * @param u the URL to load from.
 */
protected void setInstancesFromURL(URL u) {
  boolean incremental = m_readIncrementally;

  try {
    m_Loader = ConverterUtils.getURLLoaderForFile(u.toString());
    if (m_Loader == null)
      throw new Exception("No suitable URLSourcedLoader found for URL!\n" + u);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((URLSourcedLoader) m_Loader).setURL(u.toString());
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this, "Couldn't read from URL:\n" + u,
        "Load Instances", JOptionPane.ERROR_MESSAGE);
  }
}
项目:jbossBA    文件:SetInstancesPanel.java   
/**
 * Loads results from a set of instances contained in the supplied file.
 * 
 * @param f a value of type 'File'
 */
protected void setInstancesFromFile(File f) {
  boolean incremental = m_readIncrementally;

  try {
    m_Loader = ConverterUtils.getLoaderForFile(f);
    if (m_Loader == null)
      throw new Exception(Messages.getInstance().getString(
          "SetInstancesPanel_SetInstancesFromFile_Exception_Text_First")
          + f);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((FileSourcedConverter) m_Loader).setFile(f);
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane
        .showMessageDialog(
            this,
            Messages
                .getInstance()
                .getString(
                    "SetInstancesPanel_SetInstancesFromFile_Exception_JOptionPaneShowMessageDialog_Text_First")
                + f.getName(),
            Messages
                .getInstance()
                .getString(
                    "SetInstancesPanel_SetInstancesFromFile_Exception_JOptionPaneShowMessageDialog_Text_Second"),
            JOptionPane.ERROR_MESSAGE);
  }
}
项目:jbossBA    文件:SetInstancesPanel.java   
/**
 * Loads instances from a URL.
 * 
 * @param u the URL to load from.
 */
protected void setInstancesFromURL(URL u) {
  boolean incremental = m_readIncrementally;

  try {
    m_Loader = ConverterUtils.getURLLoaderForFile(u.toString());
    if (m_Loader == null)
      throw new Exception(Messages.getInstance().getString(
          "SetInstancesPanel_SetInstancesFromURL_Exception_Text_First")
          + u);

    // not an incremental loader?
    if (!(m_Loader instanceof IncrementalConverter))
      incremental = false;

    // load
    ((URLSourcedLoader) m_Loader).setURL(u.toString());
    if (incremental) {
      m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown);
      setInstances(m_Loader.getStructure());
    } else {
      m_Summary.setShowZeroInstancesAsUnknown(false);
      setInstances(m_Loader.getDataSet());
    }
  } catch (Exception ex) {
    JOptionPane
        .showMessageDialog(
            this,
            Messages
                .getInstance()
                .getString(
                    "SetInstancesPanel_SetInstancesFromURL_Exception_JOptionPaneShowMessageDialog_Text_First")
                + u,
            Messages
                .getInstance()
                .getString(
                    "SetInstancesPanel_SetInstancesFromURL_Exception_JOptionPaneShowMessageDialog_Text_Second"),
            JOptionPane.ERROR_MESSAGE);
  }
}