/** * tests whether the scheme handles instance weights correctly * * @see CheckAttributeSelection#instanceWeights(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testInstanceWeights() { boolean[] result; int i; if (m_weightedInstancesHandler) { for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.instanceWeights( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0]) System.err.println("Error handling instance weights (" + getClassTypeString(i) + " class)!"); } } }
/** * tests whether the scheme can handle missing class values (20% and * 100%) * * @see CheckAttributeSelection#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testMissingClass() { int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // 20% missing checkMissingClass(i, 20, true); // 100% missing if (m_handleMissingClass[i]) checkMissingClass(i, 100, true); } }
/** * tests whether the scheme can handle missing predictors (20% and 100%) * * @see CheckAttributeSelection#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testMissingPredictors() { int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // 20% missing checkMissingPredictors(i, 20, true); // 100% missing if (m_handleMissingPredictors[i]) checkMissingPredictors(i, 100, true); } }
/** * tests whether the scheme can handle missing predictors (20% and 100%) * * @see CheckAttributeSelection#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testMissingPredictors() { int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // 20% missing checkMissingPredictors(i, 20, true); // 100% missing if (m_handleMissingPredictors[i]) checkMissingPredictors(i, 100, true); } }
/** * tests whether the scheme can handle missing class values (20% and * 100%) * * @see CheckAttributeSelection#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testMissingClass() { int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // 20% missing checkMissingClass(i, 20, true); // 100% missing if (m_handleMissingClass[i]) checkMissingClass(i, 100, true); } }
/** * tests whether the scheme handles instance weights correctly * * @see CheckAttributeSelection#instanceWeights(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testInstanceWeights() { boolean[] result; int i; if (m_weightedInstancesHandler) { for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.instanceWeights( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0]) System.err.println("Error handling instance weights (" + getClassTypeString(i) + " class)!"); } } }
/** * tests whether scheme handles N classes * * @see CheckAttributeSelection#canHandleNClasses(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) * @see #m_NClasses */ public void testNClasses() { boolean[] result; if (!canPredict(Attribute.NOMINAL)) return; result = m_Tester.canHandleNClasses( m_NominalPredictors[Attribute.NOMINAL], m_NumericPredictors[Attribute.NOMINAL], m_StringPredictors[Attribute.NOMINAL], m_DatePredictors[Attribute.NOMINAL], m_RelationalPredictors[Attribute.NOMINAL], m_multiInstanceHandler, m_NClasses); if (!result[0] && !result[1]) fail("Error handling " + m_NClasses + " classes!"); }
/** * tests whether scheme handles N classes * * @see CheckAttributeSelection#canHandleNClasses(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) * @see #m_NClasses */ public void testNClasses() { boolean[] result; if (!canPredict(Attribute.NOMINAL)) return; result = m_Tester.canHandleNClasses( m_NominalPredictors[Attribute.NOMINAL], m_NumericPredictors[Attribute.NOMINAL], m_StringPredictors[Attribute.NOMINAL], m_DatePredictors[Attribute.NOMINAL], m_RelationalPredictors[Attribute.NOMINAL], m_multiInstanceHandler, m_NClasses); if (!result[0] && !result[1]) fail("Error handling " + m_NClasses + " classes!"); }
/** * Tests whether the scheme can handle class attributes as Nth * attribute. In case of multi-instance handler it performs no tests, * since the multi-instance data has a fixed format (bagID,bag,class). * * @see CheckAttributeSelection#canHandleClassAsNthAttribute(boolean, boolean, boolean, boolean, boolean, boolean, int, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testClassAsNthAttribute() { int i; // multi-Instance data has fixed format! if (m_multiInstanceHandler) return; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // first attribute m_handleClassAsFirstAttribute[i] = checkClassAsNthAttribute(i, 0); // second attribute m_handleClassAsSecondAttribute[i] = checkClassAsNthAttribute(i, 1); } }
/** * Tests whether the scheme can handle class attributes as Nth * attribute. In case of multi-instance handler it performs no tests, * since the multi-instance data has a fixed format (bagID,bag,class). * * @see CheckAttributeSelection#canHandleClassAsNthAttribute(boolean, boolean, boolean, boolean, boolean, boolean, int, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testClassAsNthAttribute() { int i; // multi-Instance data has fixed format! if (m_multiInstanceHandler) return; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; // first attribute m_handleClassAsFirstAttribute[i] = checkClassAsNthAttribute(i, 0); // second attribute m_handleClassAsSecondAttribute[i] = checkClassAsNthAttribute(i, 1); } }
/** * tests whether the scheme alters the training set during training. * * @see CheckAttributeSelection#datasetIntegrity(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testDatasetIntegrity() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.datasetIntegrity( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i, m_handleMissingPredictors[i], m_handleMissingClass[i]); if (!result[0] && !result[1]) fail("Dataset is altered during training (" + getClassTypeString(i) + " class)!"); } }
/** * tests whether the scheme correctly initializes in the * search method * * @see CheckAttributeSelection#correctSearchInitialisation(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testBuildInitialization() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.correctSearchInitialisation( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0] && !result[1]) fail("Incorrect build initialization (" + getClassTypeString(i) + " class)!"); } }
/** * tests whether the scheme can handle zero training instances * * @see CheckAttributeSelection#canHandleZeroTraining(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testZeroTraining() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.canHandleZeroTraining( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0] && !result[1]) fail("Error handling zero training instances (" + getClassTypeString(i) + " class)!"); } }
/** * tests whether the scheme alters the training set during training. * * @see CheckAttributeSelection#datasetIntegrity(boolean, boolean, boolean, boolean, boolean, boolean, int, boolean, boolean) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testDatasetIntegrity() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.datasetIntegrity( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i, m_handleMissingPredictors[i], m_handleMissingClass[i]); if (!result[0] && !result[1]) fail("Dataset is altered during training (" + getClassTypeString(i) + " class)!"); } }
/** * tests whether the scheme can handle zero training instances * * @see CheckAttributeSelection#canHandleZeroTraining(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testZeroTraining() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.canHandleZeroTraining( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0] && !result[1]) fail("Error handling zero training instances (" + getClassTypeString(i) + " class)!"); } }
/** * tests whether the scheme correctly initializes in the * search method * * @see CheckAttributeSelection#correctSearchInitialisation(boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckAttributeSelection#testsPerClassType(int, boolean, boolean) */ public void testBuildInitialization() { boolean[] result; int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the scheme support this type of class at all? if (!canPredict(i)) continue; result = m_Tester.correctSearchInitialisation( m_NominalPredictors[i], m_NumericPredictors[i], m_StringPredictors[i], m_DatePredictors[i], m_RelationalPredictors[i], m_multiInstanceHandler, i); if (!result[0] && !result[1]) fail("Incorrect build initialization (" + getClassTypeString(i) + " class)!"); } }
if (!canPredict(i)) continue;
if (!canPredict(i)) continue;
if (!canPredict(i)) continue;
if (!canPredict(i)) continue;