本文整理汇总了Java中com.rapidminer.example.table.ViewAttribute类的典型用法代码示例。如果您正苦于以下问题:Java ViewAttribute类的具体用法?Java ViewAttribute怎么用?Java ViewAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewAttribute类属于com.rapidminer.example.table包,在下文中一共展示了ViewAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeMeanSigmaMap.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例2: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeMeanVarianceMap.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例3: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeNames.contains(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例4: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeTransformations.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例5: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
MappingTranslation mappingTranslation = translations.get(attribute.getName());
if (!attribute.isNominal() || mappingTranslation == null) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), attribute.getValueType(),
mappingTranslation.newMapping));
}
}
return attributes;
}
示例6: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeMeanSigmaMap.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例7: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute: viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeMeanVarianceMap.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例8: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute: viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeNames.contains(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例9: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
if (!attribute.isNumerical() || !attributeTransformations.containsKey(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.NUMERICAL, null));
}
}
return attributes;
}
示例10: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet viewParent) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> roleIterator = viewParent.getAttributes().allAttributeRoles();
while (roleIterator.hasNext()) {
AttributeRole role = roleIterator.next();
if (role.isSpecial()) {
attributes.add(role);
}
}
// add regular attributes
for (Attribute attribute : viewParent.getAttributes()) {
MappingTranslation mappingTranslation = translations.get(attribute.getName());
if (!attribute.isNominal() || mappingTranslation == null) {
attributes.addRegular(attribute);
} else {
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), attribute.getValueType(), mappingTranslation.newMapping));
}
}
return attributes;
}
示例11: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet parentSet) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> specialRoles = parentSet.getAttributes().specialAttributes();
while (specialRoles.hasNext()) {
attributes.add(specialRoles.next());
}
// add regular attributes
for (Attribute attribute : parentSet.getAttributes()) {
if (!attribute.isNumerical() || !attributeNames.contains(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// create nominal mapping
SortedSet<Tupel<Double, String>> ranges = rangesMap.get(attribute.getName());
if (ranges.size() > 1) {
NominalMapping mapping = new PolynominalMapping();
for (Tupel<Double, String> rangePair : ranges) {
mapping.mapString(rangePair.getSecond());
}
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.POLYNOMINAL,
mapping));
}
}
}
return attributes;
}
示例12: createBinominalValueAttribute
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
private Attribute createBinominalValueAttribute(Attribute attribute, String value) {
NominalMapping mapping = new BinominalMapping();
mapping.mapString("false");
mapping.mapString("true");
// giving new attributes old name_value
String newName = createAttributeName(attribute.getName(), value);
Attribute newAttribute = new ViewAttribute(this, attribute, newName, Ontology.BINOMINAL, mapping);
binominalAttributeValueMap.put(newAttribute, (double) attribute.getMapping().mapString(value));
return newAttribute;
}
示例13: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet parentSet) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> specialRoles = parentSet.getAttributes().specialAttributes();
while (specialRoles.hasNext()) {
attributes.add(specialRoles.next());
}
// add regular attributes
for (Attribute attribute : parentSet.getAttributes()) {
if (!attribute.isNumerical() || !attributeNames.contains(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// create nominal mapping
SortedSet<Tupel<Double, String>> ranges = rangesMap.get(attribute.getName());
if (ranges.size() > 1) {
NominalMapping mapping = new PolynominalMapping();
for (Tupel<Double, String> rangePair : ranges) {
mapping.mapString(rangePair.getSecond());
}
// giving new attributes old name: connection to rangesMap
attributes.addRegular(
new ViewAttribute(this, attribute, attribute.getName(), Ontology.POLYNOMINAL, mapping));
}
}
}
return attributes;
}
示例14: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
public Attributes getTargetAttributes(ExampleSet parentSet) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> specialRoles = parentSet.getAttributes().specialAttributes();
while (specialRoles.hasNext()) {
attributes.add(specialRoles.next());
}
// add regular attributes
for (Attribute attribute : parentSet.getAttributes()) {
if (!attribute.isNumerical() || !attributeNames.contains(attribute.getName())) {
attributes.addRegular(attribute);
} else {
// create nominal mapping
SortedSet<Tupel<Double, String>> ranges = rangesMap.get(attribute.getName());
if (ranges.size() > 1) {
NominalMapping mapping = new PolynominalMapping();
for (Tupel<Double, String> rangePair : ranges) {
mapping.mapString(rangePair.getSecond());
}
// giving new attributes old name: connection to rangesMap
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.POLYNOMINAL, mapping));
}
}
}
return attributes;
}
示例15: getTargetAttributes
import com.rapidminer.example.table.ViewAttribute; //导入依赖的package包/类
@Override
public Attributes getTargetAttributes(ExampleSet parentSet) {
SimpleAttributes attributes = new SimpleAttributes();
// add special attributes to new attributes
Iterator<AttributeRole> specialRoles = parentSet.getAttributes().specialAttributes();
while (specialRoles.hasNext()) {
AttributeRole role = specialRoles.next();
if (role.getSpecialName().equals(Attributes.LABEL_NAME) && labelNoise != 0d) {
AttributeRole clonedRole = (AttributeRole) role.clone();
viewLabelParent = role.getAttribute();
viewLabel = new ViewAttribute(this, viewLabelParent, viewLabelParent.getName(), viewLabelParent.getValueType(), (viewLabelParent.isNominal()) ? viewLabelParent.getMapping() : null);
clonedRole.setAttribute(viewLabel);
attributes.add(clonedRole);
} else {
attributes.add(specialRoles.next());
}
}
// add regular attributes
Iterator<AttributeRole> i = parentSet.getAttributes().allAttributeRoles();
while (i.hasNext()) {
AttributeRole attributeRole = i.next();
if (!attributeRole.isSpecial()) {
Attribute attribute = attributeRole.getAttribute();
if (attribute.isNumerical()) {
attributes.addRegular(new ViewAttribute(this, attribute, attribute.getName(), Ontology.REAL, null));
} else {
attributes.add(attributeRole);
}
}
}
// add new noise attributes
for (String name: noiseAttributeNames) {
Attribute viewAttribute = new ViewAttribute(this, null, name, Ontology.REAL, null);
attributes.addRegular(viewAttribute);
noiseAttributes.add(viewAttribute);
}
return attributes;
}