Example #1
0
  /**
   * checks whether the Kernel can handle the given percentage of missing class labels
   *
   * @param type the class type
   * @param percent the percentage of missing class labels
   * @param allowFail if true a fail statement may be executed
   * @return true if the Kernel can handle it
   */
  protected boolean checkMissingClass(int type, int percent, boolean allowFail) {
    boolean[] result;

    result =
        m_Tester.canHandleMissing(
            m_NominalPredictors[type],
            m_NumericPredictors[type],
            m_StringPredictors[type],
            m_DatePredictors[type],
            m_RelationalPredictors[type],
            m_multiInstanceHandler,
            type,
            false,
            true,
            percent);

    if (allowFail) {
      if (!result[0] && !result[1])
        fail(
            "Error handling "
                + percent
                + "% missing class labels ("
                + getClassTypeString(type)
                + " class)!");
    }

    return result[0];
  }