Java 类weka.core.Version 实例源码

项目:repo.kmeanspp.silhouette_score    文件:XMLSerialization.java   
/**
 * generates internally a new XML document and clears also the IgnoreList and
 * the mappings for the Read/Write-Methods
 * 
 * @throws Exception if something goes wrong
 */
public void clear() throws Exception {
  m_Document = new XMLDocument();
  m_Document.setValidating(true);
  m_Document.newDocument(DOCTYPE, ROOT_NODE);

  m_Properties = new PropertyHandler();
  m_CustomMethods = new XMLSerializationMethodHandler(this);

  m_ClassnameOverride = new Hashtable<Class<?>, String>();
  // java.io.File is sometimes represented as another class:
  // - Win32: sun.awt.shell.Win32ShellFolder2
  // - Linux: sun.awt.shell.DefaultShellFolder
  // -> we set it to "java.io.File"
  m_ClassnameOverride.put(java.io.File.class, java.io.File.class.getName());

  setVersion(Version.VERSION);

  m_CurrentNode = null;
}
项目:repo.kmeanspp.silhouette_score    文件:XMLInstances.java   
/**
 * generates the XML structure for the header
 */
protected void headerToXML() {
  Element root;
  Element node;
  Element child;
  int i;

  root = m_Document.getDocumentElement();
  root.setAttribute(ATT_NAME, validContent(m_Instances.relationName()));
  root.setAttribute(ATT_VERSION, Version.VERSION);

  // create "header" node
  node = m_Document.createElement(TAG_HEADER);
  root.appendChild(node);

  // add all attributes
  child = m_Document.createElement(TAG_ATTRIBUTES);
  node.appendChild(child);
  for (i = 0; i < m_Instances.numAttributes(); i++) {
    addAttribute(child, m_Instances.attribute(i));
  }
}
项目:repo.kmeanspp.silhouette_score    文件:MatlabSaver.java   
/**
 * Generates a comment header.
 * 
 * @return the header
 */
protected String matlabHeader() {
  StringBuffer result;
  int i;

  result = new StringBuffer();
  result.append("% Relation: " + getInstances().relationName() + "\n");
  result.append("% Generated on: " + new Date() + "\n");
  result.append("% Generated by: WEKA " + Version.VERSION + "\n");
  result.append("%\n");

  result.append("%  ");
  for (i = 0; i < getInstances().numAttributes(); i++) {
    if (i > 0) {
      result.append((m_UseTabs ? "\t   " : "    "));
    }
    result.append(Utils.padRight(getInstances().attribute(i).name(),
      (m_UseDouble ? 16 : 8) + 5));
  }

  return result.toString();
}
项目:autoweka    文件:XMLSerialization.java   
/**
 * generates internally a new XML document and clears also the IgnoreList and
 * the mappings for the Read/Write-Methods
 * 
 * @throws Exception    if something goes wrong
 */
public void clear() throws Exception {
   m_Document = new XMLDocument();
   m_Document.setValidating(true);
   m_Document.newDocument(DOCTYPE, ROOT_NODE);

   m_Properties        = new PropertyHandler();
   m_CustomMethods     = new XMLSerializationMethodHandler(this);

   m_ClassnameOverride = new Hashtable<Class,String>();
   // java.io.File is sometimes represented as another class:
   // - Win32: sun.awt.shell.Win32ShellFolder2 
   // - Linux: sun.awt.shell.DefaultShellFolder
   // -> we set it to "java.io.File"
   m_ClassnameOverride.put(java.io.File.class, java.io.File.class.getName());

   setVersion(Version.VERSION); 

   m_CurrentNode = null;
}
项目:autoweka    文件:XMLInstances.java   
/**
 * generates the XML structure for the header
 */
protected void headerToXML() {
  Element   root;
  Element   node;
  Element   child;
  int       i;

  root = m_Document.getDocumentElement();
  root.setAttribute(ATT_NAME, validContent(m_Instances.relationName()));
  root.setAttribute(ATT_VERSION, Version.VERSION);

  // create "header" node
  node = m_Document.createElement(TAG_HEADER);
  root.appendChild(node);

  // add all attributes
  child = m_Document.createElement(TAG_ATTRIBUTES);
  node.appendChild(child);
  for (i = 0; i < m_Instances.numAttributes(); i++)
    addAttribute(child, m_Instances.attribute(i));
}
项目:autoweka    文件:MatlabSaver.java   
/**
  * Generates a comment header.
  * 
  * @return     the header
  */
 protected String matlabHeader() {
   StringBuffer result;
   int          i;

   result = new StringBuffer();
   result.append("% Relation: " + getInstances().relationName() + "\n");
   result.append("% Generated on: " + new Date() + "\n");
   result.append("% Generated by: WEKA " + Version.VERSION + "\n");
   result.append("%\n");

   result.append("%  ");
   for (i = 0; i < getInstances().numAttributes(); i++) {
     if (i > 0)
result.append((m_UseTabs ? "\t   " : "    "));
     result.append(Utils.padRight(getInstances().attribute(i).name(), (m_UseDouble ? 16 : 8) + 5));
   }

   return result.toString();
 }
项目:umple    文件:XMLSerialization.java   
/**
 * generates internally a new XML document and clears also the IgnoreList and
 * the mappings for the Read/Write-Methods
 * 
 * @throws Exception if something goes wrong
 */
public void clear() throws Exception {
  m_Document = new XMLDocument();
  m_Document.setValidating(true);
  m_Document.newDocument(DOCTYPE, ROOT_NODE);

  m_Properties = new PropertyHandler();
  m_CustomMethods = new XMLSerializationMethodHandler(this);

  m_ClassnameOverride = new Hashtable<Class<?>, String>();
  // java.io.File is sometimes represented as another class:
  // - Win32: sun.awt.shell.Win32ShellFolder2
  // - Linux: sun.awt.shell.DefaultShellFolder
  // -> we set it to "java.io.File"
  m_ClassnameOverride.put(java.io.File.class, java.io.File.class.getName());

  setVersion(Version.VERSION);

  m_CurrentNode = null;
}
项目:umple    文件:XMLInstances.java   
/**
 * generates the XML structure for the header
 */
protected void headerToXML() {
  Element root;
  Element node;
  Element child;
  int i;

  root = m_Document.getDocumentElement();
  root.setAttribute(ATT_NAME, validContent(m_Instances.relationName()));
  root.setAttribute(ATT_VERSION, Version.VERSION);

  // create "header" node
  node = m_Document.createElement(TAG_HEADER);
  root.appendChild(node);

  // add all attributes
  child = m_Document.createElement(TAG_ATTRIBUTES);
  node.appendChild(child);
  for (i = 0; i < m_Instances.numAttributes(); i++) {
    addAttribute(child, m_Instances.attribute(i));
  }
}
项目:umple    文件:MatlabSaver.java   
/**
 * Generates a comment header.
 * 
 * @return the header
 */
protected String matlabHeader() {
  StringBuffer result;
  int i;

  result = new StringBuffer();
  result.append("% Relation: " + getInstances().relationName() + "\n");
  result.append("% Generated on: " + new Date() + "\n");
  result.append("% Generated by: WEKA " + Version.VERSION + "\n");
  result.append("%\n");

  result.append("%  ");
  for (i = 0; i < getInstances().numAttributes(); i++) {
    if (i > 0) {
      result.append((m_UseTabs ? "\t   " : "    "));
    }
    result.append(Utils.padRight(getInstances().attribute(i).name(),
      (m_UseDouble ? 16 : 8) + 5));
  }

  return result.toString();
}
项目:jbossBA    文件:XMLSerialization.java   
/**
 * generates internally a new XML document and clears also the IgnoreList and
 * the mappings for the Read/Write-Methods
 * 
 * @throws Exception    if something goes wrong
 */
public void clear() throws Exception {
   m_Document = new XMLDocument();
   m_Document.setValidating(true);
   m_Document.newDocument(DOCTYPE, ROOT_NODE);

   m_Properties        = new PropertyHandler();
   m_CustomMethods     = new XMLSerializationMethodHandler(this);

   m_ClassnameOverride = new Hashtable();
   // java.io.File is sometimes represented as another class:
   // - Win32: sun.awt.shell.Win32ShellFolder2 
   // - Linux: sun.awt.shell.DefaultShellFolder
   // -> we set it to "java.io.File"
   m_ClassnameOverride.put(java.io.File.class, java.io.File.class.getName());

   setVersion(Version.VERSION); 

   m_CurrentNode = null;
}
项目:jbossBA    文件:XMLInstances.java   
/**
 * generates the XML structure for the header
 */
protected void headerToXML() {
  Element   root;
  Element   node;
  Element   child;
  int       i;

  root = m_Document.getDocumentElement();
  root.setAttribute(ATT_NAME, validContent(m_Instances.relationName()));
  root.setAttribute(ATT_VERSION, Version.VERSION);

  // create "header" node
  node = m_Document.createElement(TAG_HEADER);
  root.appendChild(node);

  // add all attributes
  child = m_Document.createElement(TAG_ATTRIBUTES);
  node.appendChild(child);
  for (i = 0; i < m_Instances.numAttributes(); i++)
    addAttribute(child, m_Instances.attribute(i));
}
项目:moa    文件:WekaUtils.java   
/**
 * Checks if the Weka version is recent enough to run MOA.
 * For example, if the Weka version is not recent, there may be problems
 * due to the fact that <code>Instance</code> was a class before 3.7.1 and
 * now is an interface.
 *
 * @return true if the Weka version is recent.
 */
public static boolean isWekaVersionOK() {
    try {
        Class.forName("weka.core.Version");
        Version version = new Version();
        if (version.isOlder("3.7.1")) {
            System.err.println();
            System.err.println(Globals.getWorkbenchInfoString());
            System.err.println();
            System.err.print("Weka 3.7.1 or higher is required to run MOA. ");
            System.err.println("Weka version " + Version.VERSION + " found");
            return false;
        } else {
            return true;
        }
    } catch (ClassNotFoundException exception) {
        // It is not available
        return true;
    }
}
项目:repo.kmeanspp.silhouette_score    文件:XML.java   
/**
 * Performs the actual printing of the header.
 */
protected void doPrintHeader() {
  append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
  append("\n");
  append(DTD + "\n\n");
  append("<" + TAG_PREDICTIONS + " " + ATT_VERSION + "=\"" + Version.VERSION + "\"" + " " + ATT_NAME + "=\"" + sanitize(m_Header.relationName()) + "\">\n");
}
项目:repo.kmeanspp.silhouette_score    文件:AbstractPMMLProducerHelper.java   
/**
 * Initializes a PMML object with header information.
 * 
 * @return an initialized PMML object
 */
public static PMML initPMML() {
  PMML pmml = new PMML();
  pmml.setVersion(PMML_VERSION);
  Header header = new Header();
  header.setCopyright("WEKA");
  header.setApplication(new Application("WEKA", Version.VERSION));
  pmml.setHeader(header);

  return pmml;
}
项目:repo.kmeanspp.silhouette_score    文件:GUIChooser.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0) {
    newTitle += " - " + title;
  }

  setTitle(newTitle);
}
项目:repo.kmeanspp.silhouette_score    文件:Main.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0) {
    newTitle += " - " + title;
  }

  setTitle(newTitle);
}
项目:autoweka    文件:XML.java   
/**
 * Performs the actual printing of the header.
 */
protected void doPrintHeader() {
  append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
  append("\n");
  append(DTD + "\n\n");
  append("<" + TAG_PREDICTIONS + " " + ATT_VERSION + "=\"" + Version.VERSION + "\"" + " " + ATT_NAME + "=\"" + sanitize(m_Header.relationName()) + "\">\n");
}
项目:autoweka    文件:GUIChooser.java   
/**
 * creates and displays the title.
 * 
 * @param title       the additional part of the title
 */
protected void createTitle(String title) {
  String      newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0)
    newTitle += " - " + title;

  setTitle(newTitle);
}
项目:autoweka    文件:Main.java   
/**
 * creates and displays the title.
 * 
 * @param title     the additional part of the title
 */
protected void createTitle(String title) {
  String    newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0)
    newTitle += " - " + title;

  setTitle(newTitle);
}
项目:umple    文件:XML.java   
/**
 * Performs the actual printing of the header.
 */
protected void doPrintHeader() {
  append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
  append("\n");
  append(DTD + "\n\n");
  append("<" + TAG_PREDICTIONS + " " + ATT_VERSION + "=\"" + Version.VERSION + "\"" + " " + ATT_NAME + "=\"" + sanitize(m_Header.relationName()) + "\">\n");
}
项目:umple    文件:AbstractPMMLProducerHelper.java   
/**
 * Initializes a PMML object with header information.
 * 
 * @return an initialized PMML object
 */
public static PMML initPMML() {
  PMML pmml = new PMML();
  pmml.setVersion(PMML_VERSION);
  Header header = new Header();
  header.setCopyright("WEKA");
  header.setApplication(new Application("WEKA", Version.VERSION));
  pmml.setHeader(header);

  return pmml;
}
项目:umple    文件:GUIChooser.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0) {
    newTitle += " - " + title;
  }

  setTitle(newTitle);
}
项目:umple    文件:Main.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle = "Weka " + new Version();
  if (title.length() != 0) {
    newTitle += " - " + title;
  }

  setTitle(newTitle);
}
项目:jbossBA    文件:GUIChooser.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle =
    Messages.getInstance().getString("GUIChooser_CreateTitle_Text_Front")
      + new Version();
  if (title.length() != 0) {
    newTitle +=
      Messages.getInstance().getString("GUIChooser_CreateTitle_Text_End")
        + title;
  }

  setTitle(newTitle);
}
项目:jbossBA    文件:Main.java   
/**
 * creates and displays the title.
 * 
 * @param title the additional part of the title
 */
protected void createTitle(String title) {
  String newTitle;

  newTitle = Messages.getInstance().getString(
    "Main_CreateTitle_NewTitle_Text")
    + new Version();
  if (title.length() != 0) {
    newTitle += " - " + title;
  }

  setTitle(newTitle);
}
项目:moa    文件:DoTask.java   
/**
 * Checks if the Weka version is recent enough to run MOA.
 * For example, if the Weka version is not recent, there may be problems
 * due to the fact that <code>Instance</code> was a class before 3.7.1 and
 * now is an interface.
 *
 * @return true if the Weka version is recent.
 */
public static boolean isWekaVersionOK() {
    Version version = new Version();
    if (version.isOlder("3.7.1")) {
        System.err.println();
        System.err.println(Globals.getWorkbenchInfoString());
        System.err.println();
        System.err.print("Weka 3.7.1 or higher is required to run MOA. ");
        System.err.println("Weka version " + Version.VERSION + " found");
        return false;
    } else {
        return true;
    }
}