weka.core.Instances.stringWithoutHeader()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中weka.core.Instances.stringWithoutHeader()方法的一些代码示例,展示了Instances.stringWithoutHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instances.stringWithoutHeader()方法的具体详情如下:
包路径:weka.core.Instances
类名称:Instances
方法名:stringWithoutHeader

Instances.stringWithoutHeader介绍

[英]Returns the instances in the dataset as a string in ARFF format. Strings are quoted if they contain whitespace characters, or if they are a question mark.
[中]以ARFF格式的字符串形式返回数据集中的实例。如果字符串包含空格字符,或者是问号,则会引用字符串。

代码示例

代码示例来源:origin: com.googlecode.obvious/obviousx-weka

@Override
protected String stringWithoutHeader() {
 return super.stringWithoutHeader();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the dataset as a string in ARFF format. Strings are quoted if they
 * contain whitespace characters, or if they are a question mark.
 * 
 * @return the dataset in ARFF format as a string
 */
@Override
public String toString() {
 StringBuffer text = new StringBuffer();
 text.append(ARFF_RELATION).append(" ").append(Utils.quote(m_RelationName))
 .append("\n\n");
 for (int i = 0; i < numAttributes(); i++) {
  text.append(attribute(i)).append("\n");
 }
 text.append("\n").append(ARFF_DATA).append("\n");
 text.append(stringWithoutHeader());
 return text.toString();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the dataset as a string in ARFF format. Strings are quoted if they
 * contain whitespace characters, or if they are a question mark.
 * 
 * @return the dataset in ARFF format as a string
 */
@Override
public String toString() {
 StringBuffer text = new StringBuffer();
 text.append(ARFF_RELATION).append(" ").append(Utils.quote(m_RelationName))
 .append("\n\n");
 for (int i = 0; i < numAttributes(); i++) {
  text.append(attribute(i)).append("\n");
 }
 text.append("\n").append(ARFF_DATA).append("\n");
 text.append(stringWithoutHeader());
 return text.toString();
}

代码示例来源:origin: Waikato/weka-trunk

text.append(prefix).append(i).append(" ").append(Utils.quote(att.value((int) value)));
} else if (att.isRelationValued()) { // Output relational value regardless
 text.append(prefix).append(i).append(" ").append(Utils.quote(att.relation((int) value).stringWithoutHeader()));
} else if (value != 0) { // Only output other attribute types if value != 0
 if (att.isNominal()) {

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

text.append(prefix).append(i).append(" ").append(Utils.quote(att.value((int) value)));
} else if (att.isRelationValued()) { // Output relational value regardless
 text.append(prefix).append(i).append(" ").append(Utils.quote(att.relation((int) value).stringWithoutHeader()));
} else if (value != 0) { // Only output other attribute types if value != 0
 if (att.isNominal()) {

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the value of a nominal, string, date, or relational attribute for
 * the instance as a string.
 * 
 * @param att the attribute
 * @return the value as a string
 * @throws IllegalArgumentException if the attribute is not a nominal, string,
 *           date, or relation-valued attribute.
 * @throws UnassignedDatasetException if the instance doesn't belong to a
 *           dataset.
 */
@Override
public final/* @pure@ */String stringValue(Attribute att) {
 int attIndex = att.index();
 if (isMissing(attIndex)) {
  return "?";
 }
 switch (att.type()) {
 case Attribute.NOMINAL:
 case Attribute.STRING:
  return att.value((int) value(attIndex));
 case Attribute.DATE:
  return att.formatDate(value(attIndex));
 case Attribute.RELATIONAL:
  return att.relation((int) value(attIndex)).stringWithoutHeader();
 default:
  throw new IllegalArgumentException(
   "Attribute isn't nominal, string or date!");
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the value of a nominal, string, date, or relational attribute for
 * the instance as a string.
 * 
 * @param att the attribute
 * @return the value as a string
 * @throws IllegalArgumentException if the attribute is not a nominal, string,
 *           date, or relation-valued attribute.
 * @throws UnassignedDatasetException if the instance doesn't belong to a
 *           dataset.
 */
@Override
public final/* @pure@ */String stringValue(Attribute att) {
 int attIndex = att.index();
 if (isMissing(attIndex)) {
  return "?";
 }
 switch (att.type()) {
 case Attribute.NOMINAL:
 case Attribute.STRING:
  return att.value((int) value(attIndex));
 case Attribute.DATE:
  return att.formatDate(value(attIndex));
 case Attribute.RELATIONAL:
  return att.relation((int) value(attIndex)).stringWithoutHeader();
 default:
  throw new IllegalArgumentException(
   "Attribute isn't nominal, string or date!");
 }
}

相关文章

Instances类方法