## Loading required package: foreach
## Loading required package: iterators
## Loading required package: parallel
## quickSentiment: Retaining negation words (e.g., 'not', 'no', 'never') to preserve sentiment polarity. To apply the strict stopword list instead, set `retain_negations = FALSE`. View qs_negations for more
result <- pipeline(
# --- Define the vectorization method ---
# Options: "bow" (raw counts), "tf" (term frequency), "tfidf", "binary"
vect_method = "tf",
# --- Define the model to train ---
# Options: "logit", "rf", "xgb","nb"
model_name = "rf",
# --- Specify the data and column names ---
text_vector = tweets$cleaned_text , # The column with our preprocessed text
sentiment_vector = tweets$sentiment, # The column with the target variable
# --- Set vectorization options ---
# Use n_gram = 2 for unigrams + bigrams, or 1 for just unigrams
n_gram = 1,
parallel = cores
)## --- Running Pipeline: TERM_FREQUENCY + RANDOM_FOREST ---
## Data split: 944 training elements, 237 test elements.
## Vectorizing with TERM_FREQUENCY (ngram=1)...
## - Fitting BoW model (term_frequency) on training data...
## - Applying BoW transformation (term_frequency) to new data...
##
## --- Training Random Forest Model (ranger) ---
## --- Random Forest complete. Returning results. ---
##
## ======================================================
## --- quickSentiment Pipeline Complete ---
## Model Type: RANDOM_FOREST
## Vectorizer: TERM_FREQUENCY (ngram=1)
## Test Set Size: 237 rows
## Accuracy of 75.53% under baseline threshold.
## ======================================================
## --- Preparing new data for prediction ---
## - Applying BoW transformation (term_frequency) to new data...
## --- Making Predictions ---
## --- Prediction Complete ---
## predicted_class prob_N prob_P
## 1 P 0.4664830 0.5335170
## 2 P 0.3152195 0.6847805
## 3 P 0.3464905 0.6535095
## 4 P 0.3411345 0.6588655
## 5 P 0.3740126 0.6259874
## 6 P 0.2542101 0.7457899
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.