Fscores_maker: Calculate F_1 scores based on SVM evaluations

Description Usage Arguments Details Value See Also Examples

Description

A function for calculating F_1 scores based on SVM evaluations

Usage

1
Fscores_maker(actual, pred)

Arguments

data

Data frame containing the actual and predicted values of the property under consideration

actual

Character string of the column name of the the actual values of the property under consideration

pred

Character string of the column name of the the predicted values of the property under consideration. Must be same length as actual.

parties

Logical vector specifying if actual and pred is party labels

Details

The F-scores are calculated as a product of true positives (TP), false negatives (FN), and false positives (FP).

Precision:

P = TP / (TP + FP)

Recall:

R = TP / (TP + FN)

F-score:

F = 2 * ((P * R) / (P + R))

Value

Returns a list with a data frame of F-scores, precision, and recall for each class, macro averaged F-score, and accuracy.

See Also

svm Fscores_boot

Other fscores: Fscores_boot

Examples

1
2
data(tonDemo)
Fscores_maker(tonDemo, "party_id", "class_token")

martigso/tonR documentation built on May 21, 2019, 12:38 p.m.