本文整理汇总了Java中com.rapidminer.operator.ports.quickfix.QuickFix类的典型用法代码示例。如果您正苦于以下问题:Java QuickFix类的具体用法?Java QuickFix怎么用?Java QuickFix使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
QuickFix类属于com.rapidminer.operator.ports.quickfix包,在下文中一共展示了QuickFix类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToBinominalFix
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Creates a quickfix to convert to nominal.
*
* @param labelName
* If null, regular attributes will be converted. Otherwise the special attribute
* with the given name will be converted.
*/
protected QuickFix createToBinominalFix(final String labelName) {
return new OperatorInsertionQuickFix("insert_nominal_to_binominal_" + (labelName != null ? "label" : "attributes"),
new Object[0], 10, getInputPort()) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(NominalToBinominal.class);
if (labelName != null) {
op.setParameter(AttributeSubsetSelector.PARAMETER_FILTER_TYPE,
AttributeSubsetSelector.CONDITION_NAMES[AttributeSubsetSelector.CONDITION_SINGLE]);
op.setParameter(AttributeSubsetSelector.PARAMETER_INCLUDE_SPECIAL_ATTRIBUTES, "true");
op.setParameter(SingleAttributeFilter.PARAMETER_ATTRIBUTE, labelName);
}
return op;
}
};
}
示例2: createToNumericalFix
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Creates a quickfix to convert to numerical.
*
* @param labelName
* If null, regular attributes will be converted. Otherwise the special attribute
* with the given name will be converted.
*/
protected QuickFix createToNumericalFix(final String labelName) {
return new OperatorInsertionQuickFix("insert_nominal_to_numerical_" + (labelName != null ? "label" : "attributes"),
new Object[0], 10, getInputPort()) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(NominalToNumeric.class);
if (labelName != null) {
op.setParameter(AttributeSubsetSelector.PARAMETER_FILTER_TYPE,
AttributeSubsetSelector.CONDITION_NAMES[AttributeSubsetSelector.CONDITION_REGULAR_EXPRESSION]);
op.setParameter(AttributeSubsetSelector.PARAMETER_INCLUDE_SPECIAL_ATTRIBUTES, "true");
op.setParameter(RegexpAttributeFilter.PARAMETER_REGULAR_EXPRESSION, labelName);
}
return op;
}
};
}
示例3: addError
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Adds an error message.
*
* @deprecated Use {@link #addError(ProcessSetupError)}
*/
@Deprecated
public void addError(final String message) {
errorList.add(new ProcessSetupError() {
@Override
public String getMessage() {
return message;
}
@Override
public PortOwner getOwner() {
return portOwner;
}
@Override
public List<QuickFix> getQuickFixes() {
return Collections.emptyList();
}
@Override
public Severity getSeverity() {
return Severity.ERROR;
}
});
}
示例4: addWarning
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Adds a warning message to the error list.
*
* @deprecated Use {@link #addError(ProcessSetupError)} *
*/
@Deprecated
public void addWarning(final String message) {
errorList.add(new ProcessSetupError() {
@Override
public String getMessage() {
return message;
}
@Override
public PortOwner getOwner() {
return portOwner;
}
@Override
public List<QuickFix> getQuickFixes() {
return Collections.emptyList();
}
@Override
public Severity getSeverity() {
return Severity.WARNING;
}
});
}
示例5: createDiscretizationFixes
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
public static List<QuickFix> createDiscretizationFixes(final InputPort inputPort, final String labelName) {
List<QuickFix> fixes = new LinkedList<QuickFix>();
for (final Class<? extends AbstractDiscretizationOperator> dclass : ALL_DISCRETIZATION_OPERATORS) {
String name = dclass.getName();
OperatorDescription ods[] = OperatorService.getOperatorDescriptions(dclass);
if (ods.length > 0) {
name = ods[0].getName();
}
fixes.add(new OperatorInsertionQuickFix("insert_discretization", new Object[] { name }, 10, inputPort) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(dclass);
if (labelName != null) {
op.setParameter(
AttributeSubsetSelector.PARAMETER_FILTER_TYPE,
AttributeSubsetSelector.CONDITION_NAMES[AttributeSubsetSelector.CONDITION_REGULAR_EXPRESSION]);
op.setParameter(AttributeSubsetSelector.PARAMETER_INCLUDE_SPECIAL_ATTRIBUTES, "true");
op.setParameter(RegexpAttributeFilter.PARAMETER_REGULAR_EXPRESSION, labelName);
}
return op;
}
});
}
return fixes;
}
示例6: getToolTipText
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
@Override
public String getToolTipText(MouseEvent e) {
Point p = e.getPoint();
int realColumnIndex = convertColumnIndexToModel(columnAtPoint(p));
int rowIndex = rowAtPoint(p);
if (rowIndex >= 0 && rowIndex < getRowCount() && realColumnIndex == 1) {
Object value = getModel().getValueAt(rowIndex, realColumnIndex);
if (value == null) {
return I18N.getMessage(I18N.getGUIBundle(), "gui.errortable.no_quickfix_available.tip");
}
if (value instanceof List) {
return I18N.getMessage(I18N.getGUIBundle(), "gui.errortable.choose_quickfix.tip", ((List) value).size());
}
if (value instanceof QuickFix) {
return ((QuickFix) value).toString();
}
}
return super.getToolTipText(e);
}
示例7: getValueAt
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
ProcessSetupError error = errors.get(rowIndex);
switch (columnIndex) {
case 0:
return error;
case 1:
List<? extends QuickFix> fixes = error.getQuickFixes();
if (fixes.size() > 1) {
return fixes;
}
if (fixes.size() == 1) {
return fixes.get(0);
}
return null;
case 2:
if (error instanceof MetaDataError) {
return ((MetaDataError) error).getPort();
} else {
return error.getOwner().getOperator();
}
default:
return null;
}
}
示例8: getQuickFixes
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Creates {@link QuickFix QuickFixes} for {@link DistanceMeasure} based errors. Will always
* suggest mixed measures, but also nominal/numeric measures if the meta data supports that.
*
* @param moreFixes
* indicates whether the meta data represents a pure nominal/numerical example set
* @param nomFixes
* if {@code true}, adds nominal measure fix, otherwise adds numerical measure fixes
* @return a list of appropriate quick fixes
*
* @since 7.6
*/
private List<QuickFix> getQuickFixes(boolean moreFixes, boolean nomFixes) {
Operator operator;
try {
operator = getInputPort().getPorts().getOwner().getOperator();
} catch (NullPointerException npe) {
return Collections.emptyList();
}
List<QuickFix> fixes = new ArrayList<>();
fixes.add(createFix(operator, DistanceMeasures.MIXED_MEASURES_TYPE));
if (moreFixes) {
if (nomFixes) {
fixes.add(createFix(operator, DistanceMeasures.NOMINAL_MEASURES_TYPE));
} else {
fixes.add(createFix(operator, DistanceMeasures.NUMERICAL_MEASURES_TYPE));
fixes.add(createFix(operator, DistanceMeasures.DIVERGENCES_TYPE));
}
}
return fixes;
}
示例9: getQuickFixes
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public List<QuickFix> getQuickFixes() {
List<QuickFix> fixes = new LinkedList<QuickFix>();
if (desiredClass != null) {
for (OutputPort outputPort : inputPort.getPorts().getOwner().getConnectionContext().getAllOutputPorts()) {
if (!outputPort.isConnected() && outputPort.getMetaData() != null
&& desiredClass.isAssignableFrom(outputPort.getMetaData().getObjectClass())) {
fixes.add(new ConnectToQuickFix(inputPort, outputPort));
}
}
fixes.add(new AddCompatibleOperatorQuickFix(inputPort, desiredClass));
}
return fixes;
}
示例10: makeError
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
private void makeError(int valueType) {
List<QuickFix> qfixes = new ArrayList<>();
switch (valueType) {
case Ontology.NOMINAL:
qfixes.add(new ParameterSettingQuickFix(operator, PARAMETER_CRITERION,
CRITERIA_NAMES[CRITERION_GAIN_RATIO]));
qfixes.add(new ParameterSettingQuickFix(operator, PARAMETER_CRITERION,
CRITERIA_NAMES[CRITERION_INFO_GAIN]));
qfixes.add(new ParameterSettingQuickFix(operator, PARAMETER_CRITERION,
CRITERIA_NAMES[CRITERION_GINI_INDEX]));
qfixes.add(new ParameterSettingQuickFix(operator, PARAMETER_CRITERION,
CRITERIA_NAMES[CRITERION_ACCURACY]));
createError(Severity.WARNING, qfixes, "tree_input.least_square_nominal",
CRITERIA_NAMES[CRITERION_LEAST_SQUARE]);
break;
case Ontology.NUMERICAL:
qfixes.add(new ParameterSettingQuickFix(operator, PARAMETER_CRITERION,
CRITERIA_NAMES[CRITERION_LEAST_SQUARE]));
createError(Severity.WARNING, qfixes, "tree_input.least_square_numerical",
CRITERIA_NAMES[CRITERION_LEAST_SQUARE]);
break;
default:
break;
}
}
示例11: modifyAttributeMetaData
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
@Override
public Collection<AttributeMetaData> modifyAttributeMetaData(ExampleSetMetaData emd, AttributeMetaData amd,
InputPort exampleSetInputPort, ParameterHandler parameterHandler) throws UndefinedParameterError {
if (amd.getValueSetRelation() == SetRelation.EQUAL) {
if (emd.getNumberOfExamples().isKnown()) {
amd.setMean(new MDReal(1d / emd.getNumberOfExamples().getValue()));
} else {
amd.setMean(new MDReal());
}
Range range = amd.getValueRange();
if (range.getLower() < 0d && !areNegativeValuesAllowed(parameterHandler)) {
List<QuickFix> quickFix = Collections.emptyList();
if (parameterHandler instanceof Operator && doesVersionCheckForNonFiniteValues(parameterHandler)) {
quickFix = Collections.singletonList(new ParameterSettingQuickFix((Operator) parameterHandler,
PARAMETER_ALLOW_NEGATIVE_VALUES, Boolean.toString(true)));
}
exampleSetInputPort.addError(new SimpleMetaDataError(Severity.WARNING, exampleSetInputPort, quickFix,
"attribute_contains_negative_values", amd.getName(), getName()));
}
} else {
// set to unknown
amd.setMean(new MDReal());
amd.setValueRange(new Range(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY), SetRelation.UNKNOWN);
}
return Collections.singleton(amd);
}
示例12: getToolTipText
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
@Override
public String getToolTipText(MouseEvent e) {
Point p = e.getPoint();
int realColumnIndex = convertColumnIndexToModel(columnAtPoint(p));
int rowIndex = rowAtPoint(p);
if (rowIndex >= 0 && rowIndex < getRowCount() && realColumnIndex == 1) {
Object value = getModel().getValueAt(rowIndex, realColumnIndex);
if (value == null) {
return I18N.getMessage(I18N.getGUIBundle(), "gui.errortable.no_quickfix_available.tip");
}
if (value instanceof List) {
return I18N.getMessage(I18N.getGUIBundle(), "gui.errortable.choose_quickfix.tip",
((List<?>) value).size());
}
if (value instanceof QuickFix) {
return ((QuickFix) value).toString();
}
}
return super.getToolTipText(e);
}
示例13: addError
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Adds an error message.
* @deprecated Use {@link #addError(ProcessSetupError)}
*/
@Deprecated
public void addError(final String message) {
errorList.add(new ProcessSetupError() {
@Override
public String getMessage() {
return message;
}
@Override
public PortOwner getOwner() {
return portOwner;
}
@Override
public List<QuickFix> getQuickFixes() {
return Collections.emptyList();
}
@Override
public Severity getSeverity() {
return Severity.ERROR;
}
});
}
示例14: addWarning
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
/**
* Adds a warning message to the error list.
* @deprecated Use {@link #addError(ProcessSetupError)} *
*/
@Deprecated
public void addWarning(final String message) {
errorList.add(new ProcessSetupError() {
@Override
public String getMessage() {
return message;
}
@Override
public PortOwner getOwner() {
return portOwner;
}
@Override
public List<QuickFix> getQuickFixes() {
return Collections.emptyList();
}
@Override
public Severity getSeverity() {
return Severity.WARNING;
}
});
}
示例15: createDiscretizationFixes
import com.rapidminer.operator.ports.quickfix.QuickFix; //导入依赖的package包/类
public static List<QuickFix> createDiscretizationFixes(final InputPort inputPort, final String labelName) {
List<QuickFix> fixes = new LinkedList<QuickFix>();
for (final Class<? extends AbstractDiscretizationOperator> dclass : ALL_DISCRETIZATION_OPERATORS) {
String name = dclass.getName();
OperatorDescription ods[] = OperatorService.getOperatorDescriptions(dclass);
if (ods.length > 0) {
name = ods[0].getName();
}
fixes.add(new OperatorInsertionQuickFix("insert_discretization", new Object[] { name }, 10, inputPort) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(dclass);
if (labelName != null) {
op.setParameter(AttributeSubsetSelector.PARAMETER_FILTER_TYPE, AttributeSubsetSelector.CONDITION_NAMES[AttributeSubsetSelector.CONDITION_REGULAR_EXPRESSION]);
op.setParameter(AttributeSubsetSelector.PARAMETER_INCLUDE_SPECIAL_ATTRIBUTES, "true");
op.setParameter(RegexpAttributeFilter.PARAMETER_REGULAR_EXPRESSION, labelName);
}
return op;
}
});
}
return fixes;
}