本文整理汇总了Java中com.rapidminer.example.Tools.getRegularAttributeNames方法的典型用法代码示例。如果您正苦于以下问题:Java Tools.getRegularAttributeNames方法的具体用法?Java Tools.getRegularAttributeNames怎么用?Java Tools.getRegularAttributeNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.example.Tools
的用法示例。
在下文中一共展示了Tools.getRegularAttributeNames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPreEvaluationPopulationOperators
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
/** The operators add the feature with the next highest weight. */
@Override
public List<PopulationOperator> getPreEvaluationPopulationOperators(ExampleSet input) throws OperatorException {
List<PopulationOperator> preOp = new LinkedList<PopulationOperator>();
String[] attributeNames = Tools.getRegularAttributeNames(input);
AttributeWeights attributeWeights = attributeWeightsInput.getData(AttributeWeights.class);
attributeWeights.sortByWeight(attributeNames, AttributeWeights.DECREASING,
getParameterAsBoolean(PARAMETER_USE_ABSOLUTE_WEIGHTS) ? AttributeWeights.ABSOLUTE_WEIGHTS
: AttributeWeights.ORIGINAL_WEIGHTS);
int[] attributeIndices = new int[input.getAttributes().size()];
int counter = 0;
for (String name : attributeNames) {
int index = 0;
for (Attribute attribute : input.getAttributes()) {
if (attribute.getName().equals(name)) {
attributeIndices[counter] = index;
break;
}
index++;
}
counter++;
}
this.maxWeightIndex = attributeIndices[0];
preOp.add(new IterativeFeatureAdding(attributeIndices, 1));
return preOp;
}
示例2: toString
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("weights:\n");
String[] attributeNames = Tools.getRegularAttributeNames(getTrainingHeader());
for (int j = 0; j < weights.length; j++) {
buffer.append(attributeNames[j] + ": " + weights[j] + "\n");
}
buffer.append("intercept" + ": " + intercept + "\n");
String string = super.toString() + "\n" + buffer.toString();
return string;
}
示例3: getPreEvaluationPopulationOperators
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
/** The operators add the feature with the next highest weight. */
@Override
public List<PopulationOperator> getPreEvaluationPopulationOperators(ExampleSet input) throws OperatorException {
List<PopulationOperator> preOp = new LinkedList<PopulationOperator>();
String[] attributeNames = Tools.getRegularAttributeNames(input);
AttributeWeights attributeWeights = attributeWeightsInput.getData(AttributeWeights.class);
attributeWeights.sortByWeight(attributeNames, AttributeWeights.DECREASING,
getParameterAsBoolean(PARAMETER_USE_ABSOLUTE_WEIGHTS) ? AttributeWeights.ABSOLUTE_WEIGHTS
: AttributeWeights.ORIGINAL_WEIGHTS);
int[] attributeIndices = new int[input.getAttributes().size()];
Attribute[] regularAttributes = input.getAttributes().createRegularAttributeArray();
int counter = 0;
for (String name : attributeNames) {
int index = 0;
for (Attribute attribute : regularAttributes) {
if (attribute.getName().equals(name)) {
attributeIndices[counter] = index;
break;
}
index++;
}
counter++;
}
this.maxWeightIndex = attributeIndices[0];
preOp.add(new IterativeFeatureAdding(attributeIndices, 1));
return preOp;
}
示例4: getPreEvaluationPopulationOperators
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
/** The operators add the feature with the next highest weight. */
@Override
public List<PopulationOperator> getPreEvaluationPopulationOperators(ExampleSet input) throws OperatorException {
List<PopulationOperator> preOp = new LinkedList<PopulationOperator>();
String[] attributeNames = Tools.getRegularAttributeNames(input);
AttributeWeights attributeWeights = attributeWeightsInput.getData(AttributeWeights.class);
attributeWeights.sortByWeight(attributeNames, AttributeWeights.DECREASING, getParameterAsBoolean(PARAMETER_USE_ABSOLUTE_WEIGHTS) ? AttributeWeights.ABSOLUTE_WEIGHTS : AttributeWeights.ORIGINAL_WEIGHTS);
int[] attributeIndices = new int[input.getAttributes().size()];
int counter = 0;
for (String name : attributeNames) {
int index = 0;
for (Attribute attribute : input.getAttributes()) {
if (attribute.getName().equals(name)) {
attributeIndices[counter] = index;
break;
}
index++;
}
counter++;
}
this.maxWeightIndex = attributeIndices[0];
preOp.add(new IterativeFeatureAdding(attributeIndices, 1));
return preOp;
}