本文整理了Java中weka.core.Utils.padRight()
方法的一些代码示例,展示了Utils.padRight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.padRight()
方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:padRight
[英]Pads a string to a specified length, inserting spaces on the right as required. If the string is too long, characters are removed (from the right).
[中]将字符串填充到指定长度,并根据需要在右侧插入空格。如果字符串太长,将删除字符(从右侧)。
代码示例来源:origin: Waikato/meka
StringBuilder sb = new StringBuilder();
for (Object k : map.keySet()) {
sb.append(Utils.padRight(k.toString(),31));
Object obj = map.get(k);
代码示例来源:origin: net.sf.meka/meka
StringBuilder sb = new StringBuilder();
for (Object k : map.keySet()) {
sb.append(Utils.padRight(k.toString(),31));
Object obj = map.get(k);
代码示例来源:origin: Waikato/weka-trunk
/**
* 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();
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* 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();
}
代码示例来源:origin: Waikato/weka-trunk
Utils.padLeft(element.toString(), element.toString().length()
+ left);
temp = Utils.padRight(temp, width);
text.append(" ").append(temp);
} else {
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
Utils.padLeft(element.toString(), element.toString().length()
+ left);
temp = Utils.padRight(temp, width);
text.append(" ").append(temp);
} else {
代码示例来源:origin: Waikato/weka-trunk
+ Utils.padRight("Variable", attNameLength)
+ " Coefficient SE of Coef t-Stat");
text.append("\n" + Utils.padRight(m_attribute.name(), attNameLength));
text.append(Utils.doubleToString(m_slope, 12, 4));
text.append(" " + Utils.doubleToString(m_seSlope, 12, 5));
text.append(" " + Utils.doubleToString(m_tstatSlope, 12, 5));
text.append(Utils.padRight("\nconst", attNameLength + 1)
+ Utils.doubleToString(m_intercept, 12, 4));
text.append(" " + Utils.doubleToString(m_seIntercept, 12, 5));
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
+ Utils.padRight("Variable", attNameLength)
+ " Coefficient SE of Coef t-Stat");
text.append("\n" + Utils.padRight(m_attribute.name(), attNameLength));
text.append(Utils.doubleToString(m_slope, 12, 4));
text.append(" " + Utils.doubleToString(m_seSlope, 12, 5));
text.append(" " + Utils.doubleToString(m_tstatSlope, 12, 5));
text.append(Utils.padRight("\nconst", attNameLength + 1)
+ Utils.doubleToString(m_intercept, 12, 4));
text.append(" " + Utils.doubleToString(m_seIntercept, 12, 5));
代码示例来源:origin: Waikato/weka-trunk
result.append('\n');
result.append(Utils.padLeft("", 5)).append(Utils.padRight("Name", 25));
result.append(Utils.padLeft("Type", 5)).append(Utils.padLeft("Nom", 5));
result.append(Utils.padLeft("Int", 5)).append(Utils.padLeft("Real", 5));
AttributeStats as = attributeStats(i);
result.append(Utils.padLeft("" + (i + 1), numDigits)).append(' ');
result.append(Utils.padRight(a.name(), 25)).append(' ');
long percent;
switch (a.type()) {
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
result.append('\n');
result.append(Utils.padLeft("", 5)).append(Utils.padRight("Name", 25));
result.append(Utils.padLeft("Type", 5)).append(Utils.padLeft("Nom", 5));
result.append(Utils.padLeft("Int", 5)).append(Utils.padLeft("Real", 5));
AttributeStats as = attributeStats(i);
result.append(Utils.padLeft("" + (i + 1), numDigits)).append(' ');
result.append(Utils.padRight(a.name(), 25)).append(' ');
long percent;
switch (a.type()) {
代码示例来源:origin: Waikato/weka-trunk
+ Utils.padRight("Variable", maxAttLength)
+ " Coefficient SE of Coef t-Stat");
column = 0;
if ((i != m_ClassIndex) && (m_SelectedAttributes[i])) {
text.append("\n"
+ Utils.padRight(m_TransformedData.attribute(i).name(),
maxAttLength));
text.append(Utils.doubleToString(m_Coefficients[column], 12,
text.append(Utils.padRight("\nconst", maxAttLength + 1)
+ Utils
.doubleToString(m_Coefficients[column], 12, m_numDecimalPlaces));
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
+ Utils.padRight("Variable", maxAttLength)
+ " Coefficient SE of Coef t-Stat");
column = 0;
if ((i != m_ClassIndex) && (m_SelectedAttributes[i])) {
text.append("\n"
+ Utils.padRight(m_TransformedData.attribute(i).name(),
maxAttLength));
text.append(Utils.doubleToString(m_Coefficients[column], 12,
text.append(Utils.padRight("\nconst", maxAttLength + 1)
+ Utils
.doubleToString(m_Coefficients[column], 12, m_numDecimalPlaces));
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (m_metricsToDisplay.contains(name.toLowerCase())) {
if (name.length() < 7) {
name = Utils.padRight(name, 7);
name, i);
if (name.length() < 7) {
name = Utils.padRight(name, 7);
Utils.padRight("?", name.length());
} else {
text.append(
.getClassWeightedAverageStatistic(name);
if (name.length() < 7) {
name = Utils.padRight(name, 7);
Utils.padRight("?", name.length());
} else {
text
代码示例来源:origin: Waikato/weka-trunk
if (m_metricsToDisplay.contains(name.toLowerCase())) {
if (name.length() < 7) {
name = Utils.padRight(name, 7);
name, i);
if (name.length() < 7) {
name = Utils.padRight(name, 7);
Utils.padRight("?", name.length());
} else {
text.append(
.getClassWeightedAverageStatistic(name);
if (name.length() < 7) {
name = Utils.padRight(name, 7);
Utils.padRight("?", name.length());
} else {
text
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
temp.append(Utils.padLeft(" ", attLength)
+ Utils.padLeft("Class", colWidth) + "\n");
temp.append(Utils.padRight("Variable", attLength));
for (int i = 0; i < m_structure.numAttributes(); i++) {
if (i != m_structure.classIndex()) {
temp.append(Utils.padRight(m_structure.attribute(i).name(), attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
temp.append(Utils.padLeft(Utils.doubleToString(m_Par[j][k], 8 + getNumDecimalPlaces(), getNumDecimalPlaces())
temp.append(Utils.padRight("Intercept", attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
temp.append(Utils.padLeft(
temp.append(Utils.padLeft(" ", attLength)
+ Utils.padLeft("Class", colWidth) + "\n");
temp.append(Utils.padRight("Variable", attLength));
for (int i = 0; i < m_structure.numAttributes(); i++) {
if (i != m_structure.classIndex()) {
temp.append(Utils.padRight(m_structure.attribute(i).name(), attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
double ORc = Math.exp(m_Par[j][k]);
代码示例来源:origin: Waikato/weka-trunk
temp.append(Utils.padLeft(" ", attLength)
+ Utils.padLeft("Class", colWidth) + "\n");
temp.append(Utils.padRight("Variable", attLength));
for (int i = 0; i < m_structure.numAttributes(); i++) {
if (i != m_structure.classIndex()) {
temp.append(Utils.padRight(m_structure.attribute(i).name(), attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
temp.append(Utils.padLeft(Utils.doubleToString(m_Par[j][k], 8 + getNumDecimalPlaces(), getNumDecimalPlaces())
temp.append(Utils.padRight("Intercept", attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
temp.append(Utils.padLeft(
temp.append(Utils.padLeft(" ", attLength)
+ Utils.padLeft("Class", colWidth) + "\n");
temp.append(Utils.padRight("Variable", attLength));
for (int i = 0; i < m_structure.numAttributes(); i++) {
if (i != m_structure.classIndex()) {
temp.append(Utils.padRight(m_structure.attribute(i).name(), attLength));
for (int k = 0; k < m_NumClasses - 1; k++) {
double ORc = Math.exp(m_Par[j][k]);
内容来源于网络,如有侵权,请联系作者删除!