本文整理汇总了Java中com.rapidminer.parameter.ParameterTypeEnumeration类的典型用法代码示例。如果您正苦于以下问题:Java ParameterTypeEnumeration类的具体用法?Java ParameterTypeEnumeration怎么用?Java ParameterTypeEnumeration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterTypeEnumeration类属于com.rapidminer.parameter包,在下文中一共展示了ParameterTypeEnumeration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParameterTypes
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public List<ParameterType> getParameterTypes() {
List<ParameterType> types = super.getParameterTypes();
ParameterType type = new ParameterTypeBoolean(PARAMETER_KEEP_EXAMPLE_SET,
"Indicates if the example set should be kept.", false);
type.setHidden(true);
types.add(type);
types.add(new ParameterTypeMatrix(PARAMETER_COST_MATRIX,
"The matrix of missclassification costs. Columns and Rows in order of internal mapping.", "Cost Matrix",
"Predicted Class", "True Class", true, false));
types.add(new ParameterTypeEnumeration(
PARAMETER_CLASS_DEFINITION,
"With this parameter it is possible to define the order of classes used in the cost matrix. First class in this list is First class in the matrix.",
new ParameterTypeString(PARAMETER_CLASS_NAME, "The name of the class."), false));
return types;
}
示例2: modifiyMetaData
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
protected ExampleSetMetaData modifiyMetaData(ExampleSetMetaData metaData, int outputIndex)
throws UndefinedParameterError {
if (metaData.getNumberOfExamples().isKnown()) {
String[] ratioList = ParameterTypeEnumeration
.transformString2Enumeration(getParameterAsString(PARAMETER_PARTITIONS));
double[] ratios = new double[ratioList.length];
if (outputIndex < ratios.length) {
int i = 0;
double sum = 0;
for (String entry : ratioList) {
ratios[i] = Double.valueOf(entry);
sum += ratios[i];
i++;
}
metaData.setNumberOfExamples((int) (ratios[outputIndex] / sum * metaData.getNumberOfExamples().getValue()));
for (AttributeMetaData amd : metaData.getAllAttributes()) {
amd.getNumberOfMissingValues().reduceByUnknownAmount();
}
} else {
return null;
}
}
return metaData;
}
示例3: EnumerationPropertyTable
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
public EnumerationPropertyTable(ParameterTypeEnumeration type, List<String> valueList, Operator operator) {
super(new String[] { type.getValueType().getKey(), type.getValueType().getKey() });
this.type = type;
this.operator = operator;
updateTableData(valueList.size());
updateEditorsAndRenderers();
int j = 0;
for (String value : valueList) {
getModel().setValueAt(value, j, 0);
j++;
}
// generating toolTip for keys
ParameterType valueType = type.getValueType();
StringBuffer toolTip = new StringBuffer(valueType.getDescription());
if ((!(valueType instanceof ParameterTypeCategory)) && (!(valueType instanceof ParameterTypeStringCategory))) {
String range = valueType.getRange();
if ((range != null) && (range.trim().length() > 0)) {
toolTip.append(" (");
toolTip.append(valueType.getRange());
toolTip.append(")");
}
}
keyToolTip = SwingTools.transformToolTipText(toolTip.toString());
}
示例4: parseParameterEnumeration
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
private List<String> parseParameterEnumeration(Element list, ParameterTypeEnumeration type) throws XMLException {
List<String> values = new LinkedList<String>();
NodeList children = list.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
if (node instanceof Element) {
Element inner = (Element) node;
if (inner.getTagName().toLowerCase().equals("parameter")) {
values.add(type.getValueType().transformNewValue(inner.getAttribute("value")));
} else {
addMessage("<em class=\"error\">Ilegal inner tag for <code><enumeration></code>: <code><"
+ inner.getTagName() + "></code>.</em>");
return new LinkedList<String>();
}
}
}
return values;
}
示例5: testParameterTypeEnumeration
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Test
public void testParameterTypeEnumeration() {
//final char internalRecordSeparator = Parameters.RECORD_SEPARATOR;
final char internalRecordSeparator = ',';
assertArrayEquals(
new String[] {
"fi"+internalRecordSeparator+"rst",
"sec"+internalRecordSeparator+"ond",
"third"+internalRecordSeparator+"" },
ParameterTypeEnumeration.transformString2Enumeration("fi\\"+internalRecordSeparator+"rst"+internalRecordSeparator+"sec\\"+internalRecordSeparator+"ond"+internalRecordSeparator+"third\\"+internalRecordSeparator+""));
List<String> enumeration = new LinkedList<String>();
enumeration.add("fi"+internalRecordSeparator+"rst");
enumeration.add("sec"+internalRecordSeparator+"ond");
enumeration.add("third"+internalRecordSeparator+"");
assertEquals("fi\\"+internalRecordSeparator+"rst"+internalRecordSeparator+"sec\\"+internalRecordSeparator+"ond"+internalRecordSeparator+"third\\"+internalRecordSeparator+"", ParameterTypeEnumeration.transformEnumeration2String(enumeration));
}
示例6: modifiyMetaData
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
protected ExampleSetMetaData modifiyMetaData(ExampleSetMetaData metaData, int outputIndex) throws UndefinedParameterError {
if (metaData.getNumberOfExamples().isKnown()) {
String[] ratioList = ParameterTypeEnumeration.transformString2Enumeration(getParameterAsString(PARAMETER_PARTITIONS));
double[] ratios = new double[ratioList.length];
if (outputIndex < ratios.length) {
int i = 0;
double sum = 0;
for (String entry : ratioList) {
ratios[i] = Double.valueOf(entry);
sum += ratios[i];
i++;
}
metaData.setNumberOfExamples((int)(ratios[outputIndex] / sum * metaData.getNumberOfExamples().getValue()));
for (AttributeMetaData amd: metaData.getAllAttributes()) {
amd.getNumberOfMissingValues().reduceByUnknownAmount();
}
} else
return null;
}
return metaData;
}
示例7: setParameters
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public void setParameters(AbstractDataResultSetReader operator) {
operator.setParameter(PARAMETER_FILE, fileName);
operator.setParameter(PARAMETER_XPATH_FOR_EXAMPLES, exampleXPath);
operator.setParameter(PARAMETER_USE_NAMESPACES, Boolean.toString(isNamespaceAware));
operator.setParameter(PARAMETER_USE_DEFAULT_NAMESPACE, Boolean.toString(getDefaultNamespaceURI() != null));
if (getDefaultNamespaceURI() != null) {
// leave unchanged if user did not select a namespace.
// this parameter is not used anyway then, since PARAMETER_USE_DEFAULT_NAMESPACE is null in this case.
operator.setParameter(PARAMETER_DEFAULT_NAMESPACE, getDefaultNamespaceURI());
}
List<String[]> list = new LinkedList<String[]>();
for (Map.Entry<String, String> entry : namespaceMap.entrySet()) {
list.add(new String[] { entry.getKey(), entry.getValue() });
}
operator.setParameter(PARAMETER_NAMESPACES, ParameterTypeList.transformList2String(list));
operator.setParameter(PARAMETER_XPATHS_FOR_ATTRIBUTES, ParameterTypeEnumeration.transformEnumeration2String(attributeXPaths));
}
示例8: EnumerationPropertyTable
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
public EnumerationPropertyTable(ParameterTypeEnumeration type, List<String> valueList, Operator operator) {
super(new String[] { type.getValueType().getKey(), type.getValueType().getKey() });
this.type = type;
this.operator = operator;
updateTableData(valueList.size());
updateEditorsAndRenderers();
int j = 0;
for (String value: valueList) {
getModel().setValueAt(value, j, 0);
j++;
}
// generating toolTip for keys
ParameterType valueType = type.getValueType();
StringBuffer toolTip = new StringBuffer(valueType.getDescription());
if ((!(valueType instanceof ParameterTypeCategory)) && (!(valueType instanceof ParameterTypeStringCategory))) {
String range = valueType.getRange();
if ((range != null) && (range.trim().length() > 0)) {
toolTip.append(" (");
toolTip.append(valueType.getRange());
toolTip.append(")");
}
}
keyToolTip = SwingTools.transformToolTipText(toolTip.toString());
}
示例9: parseParameterEnumeration
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
private List<String> parseParameterEnumeration(Element list, ParameterTypeEnumeration type) throws XMLException {
List<String> values = new LinkedList<String>();
NodeList children = list.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
if (node instanceof Element) {
Element inner = (Element) node;
if (inner.getTagName().toLowerCase().equals("parameter")) {
values.add(type.getValueType().transformNewValue(inner.getAttribute("value")));
} else {
addMessage("<em class=\"error\">Ilegal inner tag for <code><enumeration></code>: <code><" + inner.getTagName() + "></code>.</em>");
return new LinkedList<String>();
}
}
}
return values;
}
示例10: getStatementPreparationParamterTypes
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
public static List<ParameterType> getStatementPreparationParamterTypes(ParameterHandler handler) {
LinkedList types = new LinkedList();
ParameterTypeBoolean prepareParam = new ParameterTypeBoolean("prepare_statement", "If checked, the statement is prepared, and \'?\'-parameters can be filled in using the parameter \'parameters\'.", false);
types.add(prepareParam);
ParameterTypeTupel argumentType = new ParameterTypeTupel("parameter", "Parameter to insert when statement is prepared", new ParameterType[]{new ParameterTypeCategory("type", "SQL type to use for insertion.", SQL_TYPES, 0), new ParameterTypeString("parameter", "Parameter")});
ParameterTypeEnumeration paramsParam = new ParameterTypeEnumeration("parameters", "Parameters to insert into \'?\' placeholders when statement is prepared.", argumentType);
paramsParam.registerDependencyCondition(new BooleanParameterCondition(handler, "prepare_statement", false, true));
types.add(paramsParam);
return types;
}
示例11: getParameterTypes
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public List<ParameterType> getParameterTypes() {
List<ParameterType> types = super.getParameterTypes();
types.add(new ParameterTypeString(PARAMETER_MACRO, "A single macro which should be unset and removed.", true, false));
types.add(new ParameterTypeEnumeration(
PARAMETER_MACRO_ENUM,
"A list of parameter types to unset and remove. Does the same as the macro parameter, but allows to remove macros on batch.",
new ParameterTypeString(PARAMETER_MACRO, "The name of a macro which should be unset and removed"), false));
return types;
}
示例12: getParameterTypes
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public List<ParameterType> getParameterTypes() {
List<ParameterType> types = super.getParameterTypes();
types.add(new ParameterTypeEnumeration(PARAMETER_PARTITIONS, "The partitions that should be created.",
new ParameterTypeDouble(PARAMETER_RATIO, "The relative size of this partition.", 0, 1), false));
types.add(new ParameterTypeCategory(PARAMETER_SAMPLING_TYPE, "Defines the sampling type of this operator.",
SplittedExampleSet.SAMPLING_NAMES, SplittedExampleSet.SHUFFLED_SAMPLING, false));
types.addAll(RandomGenerator.getRandomGeneratorParameters(this));
return types;
}
示例13: enablePlotColumn
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
public void enablePlotColumn(String column) {
String key = PlotterAdapter.PARAMETER_PLOT_COLUMNS;
String[] oldColumns = ParameterTypeEnumeration.transformString2Enumeration(getParameter(key));
List<String> columns = new LinkedList<>();
columns.addAll(Arrays.asList(oldColumns));
columns.add(column);
setParameterAsString(key, ParameterTypeEnumeration.transformEnumeration2String(columns));
}
示例14: settingChanged
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public void settingChanged(String generalKey, String specificKey, String value) {
if (generalKey.equals(this.generalKey)) {
ListModel listModel = list.getModel();
// searching indices of selected dimensions
String names[] = ParameterTypeEnumeration.transformString2Enumeration(value);
boolean[] selectedDimensions = new boolean[listModel.getSize()];
for (int i = 0; i < names.length; i++) {
String name = names[i].trim();
for (int j = 0; j < listModel.getSize(); j++) {
if (listModel.getElementAt(j).equals(name)) {
selectedDimensions[j] = true;
break;
}
}
}
// switching all differing dimensions
setValueIsAdjusting(true);
for (int i = 0; i < listModel.getSize(); i++) {
if (selectedDimensions[i]) {
addSelectionInterval(i, i);
} else {
removeSelectionInterval(i, i);
}
}
setValueIsAdjusting(false);
}
}
示例15: getTableCellEditorComponent
import com.rapidminer.parameter.ParameterTypeEnumeration; //导入依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) {
if (value != null) {
LinkedList<String> values = new LinkedList<String>();
for (String string : ParameterTypeEnumeration.transformString2Enumeration((String) value)) {
values.add(string);
}
this.valuesList = values;
} else {
this.valuesList = new LinkedList<String>();
}
setButtonText();
return button;
}