/** * tests whether the clusterer correctly initializes in the * buildClusterer method * * @see CheckClusterer#correctBuildInitialisation(boolean, boolean, boolean, boolean, boolean, boolean) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testBuildInitialization() { boolean[] result; if (!canPredict()) return; result = m_Tester.correctBuildInitialisation( m_NominalPredictors, m_NumericPredictors, m_StringPredictors, m_DatePredictors, m_RelationalPredictors, m_multiInstanceHandler); if (!result[0] && !result[1]) fail("Incorrect build initialization!"); }
/** * tests whether the clusterer can handle different types of attributes and * if not, if the exception is OK * * @see #checkAttributes(boolean, boolean, boolean, boolean, boolean, boolean) */ public void testAttributes() { // nominal checkAttributes(true, false, false, false, false, true); // numeric checkAttributes(false, true, false, false, false, true); // string checkAttributes(false, false, true, false, false, true); // date checkAttributes(false, false, false, true, false, true); // relational if (!m_multiInstanceHandler) checkAttributes(false, false, false, false, true, true); }
/** * tests whether the clusterer can handle missing predictors (20% and 100%) * * @see CheckClusterer#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testMissingPredictors() { if (!canPredict()) return; // 20% missing checkMissingPredictors(20, true); // 100% missing if (m_handleMissingPredictors) checkMissingPredictors(100, true); }
m_Clusterer = getClusterer(); m_Tester = new CheckClusterer(); m_Tester.setSilent(true); m_Tester.setNumInstances(20); m_Tester.setDebug(DEBUG); m_OptionTester = getOptionTester(); m_GOETester = getGOETester(); checkAttributes(true, false, false, false, false, false); checkAttributes(false, true, false, false, false, false); checkAttributes(false, false, true, false, false, false); checkAttributes(false, false, false, true, false, false); checkAttributes(false, false, false, false, true, false); m_handleMissingPredictors = checkMissingPredictors(20, false);
/** * tests for a globalInfo method */ public void testGlobalInfo() { if (!m_GOETester.checkGlobalInfo()) fail("No globalInfo method"); }
m_RegressionResults = useClusterer(train); succeeded = true; reg.println(m_RegressionResults); fail("Problem during regression testing: no successful output generated"); System.err.println("Warning: No reference available, creating."); } else if (!diff.equals("")) { fail("Regression test failed. Difference:\n" + diff); fail("Problem during regression testing.\n" + ex);
/** * Configures the CheckOptionHandler uses for testing the optionhandling. * Sets the scheme to test. * * @return the fully configured CheckOptionHandler */ protected CheckOptionHandler getOptionTester() { CheckOptionHandler result; result = new CheckOptionHandler(); if (getClusterer() instanceof OptionHandler) result.setOptionHandler((OptionHandler) getClusterer()); else result.setOptionHandler(null); result.setUserOptions(new String[0]); result.setSilent(true); return result; }
/** * tests whether the clusterer handles instance weights correctly * * @see CheckClusterer#instanceWeights(boolean, boolean, boolean, boolean, boolean, boolean) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testInstanceWeights() { boolean[] result; if (m_weightedInstancesHandler) { if (!canPredict()) return; result = m_Tester.instanceWeights( m_NominalPredictors, m_NumericPredictors, m_StringPredictors, m_DatePredictors, m_RelationalPredictors, m_multiInstanceHandler); if (!result[0]) System.err.println("Error handling instance weights!"); } }
m_Clusterer = getClusterer(); m_Tester = new CheckClusterer(); m_Tester.setSilent(true); m_Tester.setNumInstances(20); m_Tester.setDebug(DEBUG); m_OptionTester = getOptionTester(); m_GOETester = getGOETester(); checkAttributes(true, false, false, false, false, false); checkAttributes(false, true, false, false, false, false); checkAttributes(false, false, true, false, false, false); checkAttributes(false, false, false, true, false, false); checkAttributes(false, false, false, false, true, false); m_handleMissingPredictors = checkMissingPredictors(20, false);
/** * tests the tool tips */ public void testToolTips() { if (!m_GOETester.checkToolTips()) fail("Tool tips inconsistent"); } }
m_RegressionResults = useClusterer(train); succeeded = true; reg.println(m_RegressionResults); fail("Problem during regression testing: no successful output generated"); System.err.println("Warning: No reference available, creating."); } else if (!diff.equals("")) { fail("Regression test failed. Difference:\n" + diff); fail("Problem during regression testing.\n" + ex);
/** * Configures the CheckGOE used for testing GOE stuff. * Sets the Clusterer returned from the getClusterer() method. * * @return the fully configured CheckGOE * @see #getClusterer() */ protected CheckGOE getGOETester() { CheckGOE result; result = new CheckGOE(); result.setObject(getClusterer()); result.setSilent(true); return result; }
/** * tests whether the clusterer handles instance weights correctly * * @see CheckClusterer#instanceWeights(boolean, boolean, boolean, boolean, boolean, boolean) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testInstanceWeights() { boolean[] result; if (m_weightedInstancesHandler) { if (!canPredict()) return; result = m_Tester.instanceWeights( m_NominalPredictors, m_NumericPredictors, m_StringPredictors, m_DatePredictors, m_RelationalPredictors, m_multiInstanceHandler); if (!result[0]) System.err.println("Error handling instance weights!"); } }
/** * tests whether the scheme declares a serialVersionUID. */ public void testSerialVersionUID() { boolean[] result; result = m_Tester.declaresSerialVersionUID(); if (!result[0]) fail("Doesn't declare serialVersionUID!"); }
/** * tests whether the clusterer can handle zero training instances * * @see CheckClusterer#canHandleZeroTraining(boolean, boolean, boolean, boolean, boolean, boolean) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testZeroTraining() { boolean[] result; if (!canPredict()) return; result = m_Tester.canHandleZeroTraining( m_NominalPredictors, m_NumericPredictors, m_StringPredictors, m_DatePredictors, m_RelationalPredictors, m_multiInstanceHandler); if (!result[0] && !result[1]) fail("Error handling zero training instances!"); }
/** * tests whether the clusterer can handle missing predictors (20% and 100%) * * @see CheckClusterer#canHandleMissing(boolean, boolean, boolean, boolean, boolean, boolean, boolean, int) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testMissingPredictors() { if (!canPredict()) return; // 20% missing checkMissingPredictors(20, true); // 100% missing if (m_handleMissingPredictors) checkMissingPredictors(100, true); }
/** * Configures the CheckOptionHandler uses for testing the optionhandling. * Sets the scheme to test. * * @return the fully configured CheckOptionHandler */ protected CheckOptionHandler getOptionTester() { CheckOptionHandler result; result = new CheckOptionHandler(); if (getClusterer() instanceof OptionHandler) result.setOptionHandler((OptionHandler) getClusterer()); else result.setOptionHandler(null); result.setUserOptions(new String[0]); result.setSilent(true); return result; }
/** * tests whether the clusterer can handle different types of attributes and * if not, if the exception is OK * * @see #checkAttributes(boolean, boolean, boolean, boolean, boolean, boolean) */ public void testAttributes() { // nominal checkAttributes(true, false, false, false, false, true); // numeric checkAttributes(false, true, false, false, false, true); // string checkAttributes(false, false, true, false, false, true); // date checkAttributes(false, false, false, true, false, true); // relational if (!m_multiInstanceHandler) checkAttributes(false, false, false, false, true, true); }
/** * tests for a globalInfo method */ public void testGlobalInfo() { if (!m_GOETester.checkGlobalInfo()) fail("No globalInfo method"); }
/** * tests whether the clusterer correctly initializes in the * buildClusterer method * * @see CheckClusterer#correctBuildInitialisation(boolean, boolean, boolean, boolean, boolean, boolean) * @see CheckClusterer#runTests(boolean, boolean, boolean) */ public void testBuildInitialization() { boolean[] result; if (!canPredict()) return; result = m_Tester.correctBuildInitialisation( m_NominalPredictors, m_NumericPredictors, m_StringPredictors, m_DatePredictors, m_RelationalPredictors, m_multiInstanceHandler); if (!result[0] && !result[1]) fail("Incorrect build initialization!"); }