/** * @param a attribute to check * @return true if any parent branch used the same attribute to split on */ private boolean hasSplitOnAttributePreviously(Attribute a) { TreeNode n = this; while (n != null) { if (n.split != null && n.split.attribute.equals(a)) { return true; } n = n.parent; } return false; }
if (!m_data.classAttribute().equals(toAggregate.m_data.classAttribute())) { throw new Exception("Can't aggregate - class attribute in data headers " + "does not match: "
/** * Equals. Just compares attribute. * @return true if this Item is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof Item)) { return false; } Item b = (Item)compareTo; if (m_attribute.equals(b.getAttribute())) { return true; } return false; }
if (!m_data.classAttribute().equals(toAggregate.m_data.classAttribute())) { throw new Exception("Can't aggregate - class attribute in data headers " + "does not match: "
/** * Equals. Just compares attribute. * @return true if this Item is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof Item)) { return false; } Item b = (Item)compareTo; if (m_attribute.equals(b.getAttribute())) { return true; } return false; }
/** * Equals. Just compares attribute and valueIndex. * @return true if this BinaryItem is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof BinaryItem)) { return false; } BinaryItem b = (BinaryItem)compareTo; if (m_attribute.equals(b.getAttribute()) && // m_frequency == b.getFrequency() && m_valueIndex == b.getValueIndex()) { return true; } return false; }
/** * Equals. Compares the attribute, numeric test and comparison operator * * @return true if this NumericItem is equal to the argument. */ @Override public boolean equals(Object compareTo) { if (!(compareTo instanceof NumericItem)) { return false; } NumericItem b = (NumericItem) compareTo; if (m_attribute.equals(b.getAttribute()) && m_comparison == b.getComparison() && (new Double(m_splitPoint).equals(new Double(b.getSplitPoint())))) { return true; } return false; } }
/** * Equals. Compares the attribute, numeric test and comparison operator * * @return true if this NumericItem is equal to the argument. */ @Override public boolean equals(Object compareTo) { if (!(compareTo instanceof NumericItem)) { return false; } NumericItem b = (NumericItem) compareTo; if (m_attribute.equals(b.getAttribute()) && m_comparison == b.getComparison() && (new Double(m_splitPoint).equals(new Double(b.getSplitPoint())))) { return true; } return false; } }
/** * Equals. Just compares attribute and valueIndex. * @return true if this BinaryItem is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof BinaryItem)) { return false; } BinaryItem b = (BinaryItem)compareTo; if (m_attribute.equals(b.getAttribute()) && // m_frequency == b.getFrequency() && m_valueIndex == b.getValueIndex()) { return true; } return false; }
/** * Equals. Just compares attribute and valueIndex. * @return true if this NominalItem is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof NominalItem)) { return false; } NominalItem b = (NominalItem)compareTo; if (m_attribute.equals(b.getAttribute()) && // m_frequency == b.getFrequency() && m_valueIndex == b.getValueIndex()) { return true; } return false; } }
/** * Equals. Just compares attribute and valueIndex. * @return true if this NominalItem is equal to the argument. */ public boolean equals(Object compareTo) { if (!(compareTo instanceof NominalItem)) { return false; } NominalItem b = (NominalItem)compareTo; if (m_attribute.equals(b.getAttribute()) && // m_frequency == b.getFrequency() && m_valueIndex == b.getValueIndex()) { return true; } return false; } }
+ copy.equals(position));
+ copy.equals(position));
if ((!classAttribute.equals(data.classAttribute())) && (!m_DoNotCheckForModifiedClassAttribute)) { throw new IllegalArgumentException("Cannot proceed: " + getFilterSpec() + " has modified the class attribute!");
if ((!classAttribute.equals(data.classAttribute())) && (!m_DoNotCheckForModifiedClassAttribute)) { throw new IllegalArgumentException("Cannot proceed: " + getFilterSpec() + " has modified the class attribute!");
while(attrEnum.hasMoreElements()) { Attribute attr = (Attribute) attrEnum.nextElement(); if (!attr.equals(getInputFormat().classAttribute())) { if (attr.isNominal() || attr.isString()) { double[][] vdm = new double[attr.numValues()][attr.numValues()]; while(attrEnum.hasMoreElements()) { Attribute attr = (Attribute) attrEnum.nextElement(); if (!attr.equals(getInputFormat().classAttribute())) { double iVal = instanceI.value(attr); double jVal = instanceJ.value(attr); while(attrEnum.hasMoreElements()) { Attribute attr = (Attribute) attrEnum.nextElement(); if (!attr.equals(getInputFormat().classAttribute())) { if (attr.isNumeric()) { double dif = nnArray[nn].value(attr) - instanceI.value(attr);
/** * Sets up the filter and runs checks. * * @return filtered data */ protected Instances setUp(Instances data) throws Exception { String relName; String classAtt; relName = data.relationName(); classAtt = data.classAttribute().name(); if (m_Classifier == null) throw new Exception("No base classifiers have been set!"); getCapabilities().testWithFail(data); // get fresh instances object data = new Instances(data); Attribute classAttribute = (Attribute)data.classAttribute().copy(); m_Filter.setInputFormat(data); // filter capabilities are checked here data = Filter.useFilter(data, m_Filter); if ((!classAttribute.equals(data.classAttribute())) && (!m_DoNotCheckForModifiedClassAttribute)) throw new IllegalArgumentException("Cannot proceed: " + getFilterSpec() + " has modified the class attribute!"); data.setRelationName(relName); data.setClassIndex(data.attribute(classAtt).index()); // can classifier handle the data? testCapabilities(data); m_FilteredInstances = data.stringFreeStructure(); return data; }
/** * Sets up the filter and runs checks. * * @return filtered data */ protected Instances setUp(Instances data) throws Exception { String relName; String classAtt; relName = data.relationName(); classAtt = data.classAttribute().name(); if (m_Classifier == null) throw new Exception("No base classifiers have been set!"); getCapabilities().testWithFail(data); // get fresh instances object data = new Instances(data); Attribute classAttribute = (Attribute)data.classAttribute().copy(); m_Filter.setInputFormat(data); // filter capabilities are checked here data = Filter.useFilter(data, m_Filter); if ((!classAttribute.equals(data.classAttribute())) && (!m_DoNotCheckForModifiedClassAttribute)) throw new IllegalArgumentException("Cannot proceed: " + getFilterSpec() + " has modified the class attribute!"); data.setRelationName(relName); data.setClassIndex(data.attribute(classAtt).index()); // can classifier handle the data? testCapabilities(data); m_FilteredInstances = data.stringFreeStructure(); return data; }
for (int i = 0; i < testSet.numAttributes(); i++) { if (i != testSet.classIndex()) { ok = testSet.attribute(i).equals(m_trainingSet.attribute(i)); if (!ok) { break;
for (int i = 0; i < testSet.numAttributes(); i++) { if (i != testSet.classIndex()) { ok = testSet.attribute(i).equals(m_trainingSet.attribute(i)); if (!ok) { break;