当前位置: 首页>>代码示例>>Java>>正文


Java Tools.getRegularAttributeNames方法代码示例

本文整理汇总了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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:31,代码来源:WeightGuidedSelectionOperator.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:13,代码来源:LinearModel.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:32,代码来源:WeightGuidedSelectionOperator.java

示例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;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:29,代码来源:WeightGuidedSelectionOperator.java


注:本文中的com.rapidminer.example.Tools.getRegularAttributeNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。