/** * Checks whether the scheme can build models incrementally. * * @return index 0 is true if the estimator can train incrementally */ protected boolean[] incrementalEstimator() { boolean[] result = new boolean[2]; print("incremental estimator..."); if (m_Estimator instanceof IncrementalEstimator) { println("yes"); result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme says it can handle instance weights. * * @return true if the estimator handles instance weights */ protected boolean[] weightedInstancesHandler() { boolean[] result = new boolean[2]; print("weighted instances estimator..."); if (m_Estimator instanceof WeightedInstancesHandler) { println("yes"); result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can build models incrementally. * * @return index 0 is true if the estimator can train incrementally */ protected boolean[] incrementalEstimator() { boolean[] result = new boolean[2]; print("incremental estimator..."); if (m_Estimator instanceof IncrementalEstimator) { println("yes"); result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme says it can handle instance weights. * * @return true if the estimator handles instance weights */ protected boolean[] weightedInstancesHandler() { boolean[] result = new boolean[2]; print("weighted instances estimator..."); if (m_Estimator instanceof WeightedInstancesHandler) { println("yes"); result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the estimator can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Estimator instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Estimator).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
/** * Checks whether the scheme can take command line options. * * @return index 0 is true if the estimator can take options */ protected boolean[] canTakeOptions() { boolean[] result = new boolean[2]; print("options..."); if (m_Estimator instanceof OptionHandler) { println("yes"); if (m_Debug) { println("\n=== Full report ==="); Enumeration<Option> enu = ((OptionHandler) m_Estimator).listOptions(); while (enu.hasMoreElements()) { Option option = enu.nextElement(); print(option.synopsis() + "\n" + option.description() + "\n"); } println("\n"); } result[0] = true; } else { println("no"); result[0] = false; } return result; }
println("no"); result[0] = false; println("\n=== Full Report ==="); println("Results differ between batch and " + "incrementally built models.\n" + "Depending on the estimator, this may be OK"); println("Here are the results:\n"); println("batch built results\n" + estimators[0].toString()); println("incrementally built results\n" + estimators[1].toString()); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n"); println("yes"); result[0] = true; print(" training"); println(": " + ex.getMessage() + "\n");
println("no"); result[0] = false; println("\n=== Full Report ==="); println("Results differ between batch and " + "incrementally built models.\n" + "Depending on the estimator, this may be OK"); println("Here are the results:\n"); println("batch built results\n" + estimators[0].toString()); println("incrementally built results\n" + estimators[1].toString()); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n"); println("yes"); result[0] = true; print(" training"); println(": " + ex.getMessage() + "\n");
println("yes"); result[0] = true; } catch (Exception ex) { println("no" + (acceptable ? " (OK error message)" : "")); result[1] = acceptable; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); if (!acceptable) { if (accepts.size() > 0) { println("here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n");
println("yes"); result[0] = true; } catch (Exception ex) { println("no" + (acceptable ? " (OK error message)" : "")); result[1] = acceptable; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); if (!acceptable) { if (accepts.size() > 0) { println("here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n");
println("yes"); result[0] = true; } catch (Exception ex) { println("no" + (acceptable ? " (OK error message)" : "")); result[1] = acceptable; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); if (!acceptable) { if (accepts.size() > 0) { println("here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n");
println("yes"); result[0] = true; } catch (Exception ex) { println("no" + (acceptable ? " (OK error message)" : "")); result[1] = acceptable; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); if (!acceptable) { if (accepts.size() > 0) { println("here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Test Dataset ===\n" + test.toString() + "\n\n");
built = true; println("yes"); result[0] = true; } catch (Exception ex) { println("no"); result[0] = false; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n");
/** * Begin the tests, reporting results to System.out */ public void doTests() { if (getEstimator() == null) { println("\n=== No estimator set ==="); return; } println("\n=== Check on Estimator: " + getEstimator().getClass().getName() + " ===\n"); m_ClasspathProblems = false; // Start tests with test for options canTakeOptions(); // test what type of estimator it is EstTypes estTypes = new EstTypes(); estTypes.incremental = incrementalEstimator()[0]; estTypes.weighted = weightedInstancesHandler()[0]; estTypes.supervised = supervisedEstimator()[0]; // in none of the estimators yet the functionality is depending on the class // type // since this could change the basic structure taken from checkclassifiers // is kept here int classType = Attribute.NOMINAL; AttrTypes attrTypes = testsPerClassType(classType, estTypes); // only nominal class can be split up so far canSplitUpClass(attrTypes, classType); }
built = true; println("yes"); result[0] = true; } catch (Exception ex) { println("no"); result[0] = false; println("\n=== Full Report ==="); print("Problem during"); if (built) { print(" training"); println(": " + ex.getMessage() + "\n"); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n");
println("yes"); result[0] = true; } catch (Exception ex) { println("no"); result[0] = false; println("\n=== Full Report ==="); println("Results don't differ between non-weighted and " + "weighted instance models."); println("Here are the results:\n"); println(probsToString(resultProbsO)); } else { print("Problem during"); print(" training"); println(": " + ex.getMessage() + "\n"); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Train Weights ===\n"); for (int i = 0; i < train.numInstances(); i++) { println(" " + (i + 1) + " " + train.instance(i).weight()); println("=== Test Dataset ===\n" + test.toString() + "\n\n"); println("(test weights all 1.0\n");
/** * Begin the tests, reporting results to System.out */ public void doTests() { if (getEstimator() == null) { println("\n=== No estimator set ==="); return; } println("\n=== Check on Estimator: " + getEstimator().getClass().getName() + " ===\n"); m_ClasspathProblems = false; // Start tests with test for options canTakeOptions(); // test what type of estimator it is EstTypes estTypes = new EstTypes(); estTypes.incremental = incrementalEstimator()[0]; estTypes.weighted = weightedInstancesHandler()[0]; estTypes.supervised = supervisedEstimator()[0]; // in none of the estimators yet the functionality is depending on the class // type // since this could change the basic structure taken from checkclassifiers // is kept here int classType = Attribute.NOMINAL; AttrTypes attrTypes = testsPerClassType(classType, estTypes); // only nominal class can be split up so far canSplitUpClass(attrTypes, classType); }
println("yes"); result[0] = true; } catch (Exception ex) { println("no"); result[0] = false; println("\n=== Full Report ==="); println("Results don't differ between non-weighted and " + "weighted instance models."); println("Here are the results:\n"); println(probsToString(resultProbsO)); } else { print("Problem during"); print(" training"); println(": " + ex.getMessage() + "\n"); println("Here are the datasets:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); println("=== Train Weights ===\n"); for (int i = 0; i < train.numInstances(); i++) { println(" " + (i + 1) + " " + train.instance(i).weight()); println("=== Test Dataset ===\n" + test.toString() + "\n\n"); println("(test weights all 1.0\n");
if (!estimator.equals(estimator1)) { if (m_Debug) { println("\n=== Full report ===\n" + "\nFirst build estimator\n" + estimator.toString() + "\n\n"); println("\nSecond build estimator\n" + estimator.toString() + "\n\n"); println("yes"); result[0] = true; String msg = ex.getMessage().toLowerCase(); if (msg.indexOf("worse than zeror") >= 0) { println("warning: performs worse than ZeroR"); result[0] = true; result[1] = true; } else { println("no"); result[0] = false; println("\n=== Full Report ==="); print("Problem during"); if (built) { break; println(": " + ex.getMessage() + "\n"); println("here are the datasets:\n"); println("=== Train1 Dataset ===\n" + train1.toString() + "\n"); println("=== Train2 Dataset ===\n" + train2.toString() + "\n");
if (!estimator.equals(estimator1)) { if (m_Debug) { println("\n=== Full report ===\n" + "\nFirst build estimator\n" + estimator.toString() + "\n\n"); println("\nSecond build estimator\n" + estimator.toString() + "\n\n"); println("yes"); result[0] = true; String msg = ex.getMessage().toLowerCase(); if (msg.indexOf("worse than zeror") >= 0) { println("warning: performs worse than ZeroR"); result[0] = true; result[1] = true; } else { println("no"); result[0] = false; println("\n=== Full Report ==="); print("Problem during"); if (built) { break; println(": " + ex.getMessage() + "\n"); println("here are the datasets:\n"); println("=== Train1 Dataset ===\n" + train1.toString() + "\n"); println("=== Train2 Dataset ===\n" + train2.toString() + "\n");