
Sentiment Analysis of Stock Market Behavior from Twitter Using the R Tool 233
# save R objects required for future tasks
save(list=c("total", "n_training", "svm_results", "nb_results", "total_GI",
"total_FIN", "DTM_GI", "DTM_FIN"), file="sent_analysis.RData"),→
The load function reads preprocessed data. In this example, ML models are created in
the training set composed by the first 75% messages, whereas the evaluation of all meth-
ods is performed in the test set containing the remaining 25% tweets. The 75%–25% is a
commonly adopted holdout split for evaluating the quality of the ML predictions. Also,
only one run is executed for each ML model in