evaluate_Weka_classifier        package:RWeka        R Documentation

_M_o_d_e_l _S_t_a_t_i_s_t_i_c_s _f_o_r _R/_W_e_k_a _C_l_a_s_s_i_f_i_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute model performance statistics for a fitted Weka classifier.

_U_s_a_g_e:

     evaluate_Weka_classifier(object, newdata = NULL, cost = NULL, 
                              numFolds = 0, complexity = FALSE,
                              class = FALSE, seed = NULL, ...)

_A_r_g_u_m_e_n_t_s:

  object: a 'Weka_classifier' object.

 newdata: an optional data frame in which to look for variables with
          which to evaluate.  If omitted or 'NULL', the training
          instances are used.

    cost: a square matrix of (mis)classification costs.

numFolds: the number of folds to use in cross-validation.

complexity: option to include entropy-based statistics.

   class: option to include class statistics.

    seed: optional seed for cross-validation.

     ...: further arguments passed to other methods (see details).

_D_e_t_a_i_l_s:

     The function computes and extracts a non-redundant set of
     performance  statistics that is suitable for model interpretation.
     By default the  statistics are computed on the training data.

     Currently argument '...' only supports the logical variable
     'normalize' which tells Weka to normalize the cost matrix so that
     the cost of a correct classification is zero.

_V_a_l_u_e:

     An object of class 'Weka_classifier_evaluation', a list of the
     following components:

  string: character, concatenation of the string representations of the
          performance statistics.

 details: vector, base statistics, e.g., the percentage of instances
          correctly classified, etc.

detailsComplexity: vector, entropy-based statistics (if selected).

detailsClass: matrix, class statistics, e.g., the true positive rate,
          etc., for each level of the response variable (if selected).

confusionMatrix: table, cross-classification of true and predicted
          classes.

_R_e_f_e_r_e_n_c_e_s:

     I. H. Witten and E. Frank (2005). _Data Mining: Practical Machine
     Learning Tools and Techniques_. 2nd Edition, Morgan Kaufmann, San
     Francisco.

_E_x_a_m_p_l_e_s:

     ## Use some example data.
     w <- read.arff(system.file("arff","weather.nominal.arff", 
                    package = "RWeka"))

     ## Identify a decision tree.
     m <- J48(play~., data = w)
     m

     ## Use 10 fold cross-validation.
     e <- evaluate_Weka_classifier(m,
                                   cost = matrix(c(0,2,1,0), ncol = 2),
                                   numFolds = 10, complexity = TRUE,
                                   seed = 123, class = TRUE)
     e
     summary(e)
     e$details

