The FitC
trait provides methods for determining the confusion matrix as well as derived Quality of Fit (QoF) measures such as pseudo R-squared, sst, sse, accuracy, precision, recall, specificity and Cohen's kappa coefficient.
Value parameters
- k
-
the number distinct class values/labels (defaults to 2)
Attributes
- See also
-
modeling.Fit
Must call the confusion method before calling the other methods. - Companion
- object
- Graph
-
- Supertypes
- Known subtypes
-
class BaggingTreesclass RandomForestclass DecisionTree_C45class DecisionTree_C45wpclass DecisionTree_ID3class DecisionTree_ID3wpclass HiddenMarkovclass KNN_Classifierclass LinDiscAnalyisclass NaiveBayesclass NaiveBayesRclass NeuralNet_Class_3Lclass NullModelclass SimpleLDAclass SimpleLogisticRegressionclass LogisticRegressionclass SupportVectorMachineclass TANBayesShow all
Members list
Value members
Concrete methods
Compute the accuracy of the classification, i.e., the fraction of correct classifications. Note, the correct classifications tp_i are in the main diagonal of the confusion matrix.
Compute the accuracy of the classification, i.e., the fraction of correct classifications. Note, the correct classifications tp_i are in the main diagonal of the confusion matrix.
Attributes
Clear the total cummulative confusion matrix.
Clear the total cummulative confusion matrix.
Attributes
Compare the actual class y vector versus the predicted class yp vector, returning the confusion matrix cmat, which for k = 2 is yp 0 1 ---------- y 0 | tn fp | 1 | fn tp | ---------- Note: ScalaTion's confusion matrix is Actual × Predicted, but to swap the position of actual y (rows) with predicted yp (columns) simply use cmat.transpose, the transpose of cmat.
Compare the actual class y vector versus the predicted class yp vector, returning the confusion matrix cmat, which for k = 2 is yp 0 1 ---------- y 0 | tn fp | 1 | fn tp | ---------- Note: ScalaTion's confusion matrix is Actual × Predicted, but to swap the position of actual y (rows) with predicted yp (columns) simply use cmat.transpose, the transpose of cmat.
Value parameters
- y_
-
the actual class values/labels for full (y) or test (y_e) dataset
- yp
-
the predicted class values/labels
Attributes
- See also
Contract the actual class y_ vector versus the predicted class yp vector.
Contract the actual class y_ vector versus the predicted class yp vector.
Value parameters
- y_
-
the actual class values/labels for full (y) or test (y_e) dataset
- yp
-
the predicted class values/labels
Attributes
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.
Value parameters
- w
-
the weights on the instances (defaults to null)
- y_
-
the actual response/output vector to use (test/full)
- yp
-
the predicted response/output vector (test/full)
Attributes
- Definition Classes
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. Requires the actual and predicted responses to be non-negative integers. Must override when there negative responses.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. Requires the actual and predicted responses to be non-negative integers. Must override when there negative responses.
Value parameters
- y_
-
the actual response/output vector to use (test/full)
- yp
-
the predicted response/output vector (test/full)
Attributes
Compute the F1-measure, i.e., the harmonic mean of the precision and recall.
Compute the F1-measure, i.e., the harmonic mean of the precision and recall.
Value parameters
- p
-
the precision
- r
-
the recall
Attributes
Compute the micro-F1-measure vector, i.e., the harmonic mean of the precision and recall.
Compute the micro-F1-measure vector, i.e., the harmonic mean of the precision and recall.
Attributes
Return the Quality of Fit (QoF) measures corresponding to the labels given above in the fitLabel method.
Return the Quality of Fit (QoF) measures corresponding to the labels given above in the fitLabel method.
Attributes
Return the labels for the Quality of Fit (QoF) measures. Override to add additional QoF measures.
Return the labels for the Quality of Fit (QoF) measures. Override to add additional QoF measures.
Attributes
Return the Quality of Fit (QoF) vector micro-measures, i.e., measures for each class.
Return the Quality of Fit (QoF) vector micro-measures, i.e., measures for each class.
Attributes
Return the help string that describes the Quality of Fit (QoF) measures provided by the FitC
class. Override to correspond to fitLabel.
Return the help string that describes the Quality of Fit (QoF) measures provided by the FitC
class. Override to correspond to fitLabel.
Attributes
Compute Cohen's kappa coefficient that measures agreement between actual y and predicted yp classifications.
Compute Cohen's kappa coefficient that measures agreement between actual y and predicted yp classifications.
Value parameters
- y_
-
the actual response/output vector to use (test/full)
- yp
-
the predicted response/output vector (test/full)
Attributes
- See also
-
en.wikipedia.org/wiki/Cohen%27s_kappa
Compute the micro-precision, micro-recall and micro-specificity vectors which have elements for each class i in {0, 1, ... k-1}. Precision is the fraction classified as true that are actually true. Recall (sensitivity) is the fraction of the actually true that are classified as true. Specificity is the fraction of the actually false that are classified as false. Note, for k = 2, ordinary precision p, recall r and specificity s will correspond to the last elements in the pv, rv and sv micro vectors.
Compute the micro-precision, micro-recall and micro-specificity vectors which have elements for each class i in {0, 1, ... k-1}. Precision is the fraction classified as true that are actually true. Recall (sensitivity) is the fraction of the actually true that are classified as true. Specificity is the fraction of the actually false that are classified as false. Note, for k = 2, ordinary precision p, recall r and specificity s will correspond to the last elements in the pv, rv and sv micro vectors.
Attributes
Compute the Efron's pseudo R-squared value. Override to McFadden's, etc.
Compute the Efron's pseudo R-squared value. Override to McFadden's, etc.
Value parameters
- p1
-
the first parameter
- p2
-
the second parameter
Attributes
Produce a summary report with diagnostics and the overall Quality of Fit (QoF). Classifier should override this method.
Produce a summary report with diagnostics and the overall Quality of Fit (QoF). Classifier should override this method.
Value parameters
- b
-
the parameters/pmf for the model
- fname
-
the array of feature/variable names
- vifs
-
the Variance Inflation Factors (VIFs)
- x_
-
the testing/full data/input matrix
Attributes
Return the confusion matrix for k = 2 as a tuple (tn, fp, fn, tp).
Return the confusion matrix for k = 2 as a tuple (tn, fp, fn, tp).
Value parameters
- con
-
the confusion matrix (defaults to cmat)
Attributes
Return a copy of the total cumulative confusion matrix tcmat and clear tcmat.
Return a copy of the total cumulative confusion matrix tcmat and clear tcmat.
Attributes
Inherited methods
Return the coefficient of determination (R^2). Must call diagnose first.
Return the coefficient of determination (R^2). Must call diagnose first.
Attributes
- Inherited from:
- FitM