predictions {GTbasedIM} | R Documentation |
Predictions Function: Generate predictions using classifiers from RWeka
Description
This function trains three different classifiers—Random Forest (RF), Support Vector Machine (SVM), and Logistic Regression (LR)—on the input dataset and returns their predictions.
Usage
predictions(Xdata, Ydata)
Arguments
Xdata |
Matrix. A dataset where rows represent observations and columns represent features. |
Ydata |
Vector. The actual response variable associated with each row in |
Details
The function utilizes the RWeka package to build three different classifiers: Random Forest (RF), Support Vector Machine (SVM), and Logistic Regression (LR). It then predicts the response variable for the input data using each of these models.
Value
A list containing predictions from the three models:
predictionRF
Predictions from the Random Forest (RF) model.
predictionSVM
Predictions from the Support Vector Machine (SVM) model.
predictionLR
Predictions from the Logistic Regression (LR) model.
References
Davila-Pena, L., Saavedra-Nieves, A., & Casas-Méndez, B. (2024). On the influence of dependent features in classification problems: a game-theoretic perspective. arXiv preprint. doi:10.48550/arXiv.2408.02481.
Examples
# Example usage:
X <- matrix(rnorm(100), ncol=5)
Y <- sample(0:1, 20, replace=TRUE)
predictions(X, Y)