Description Usage Arguments Value See Also Examples
View source: R/plot_predictor_words.R
This function plots predictive words from the results of the assess_models
function
1 2 3 4 5 6 7 8 9 10 11 12 |
... |
Output(s) of the |
topX |
The number of most-predictive words to plot |
colors |
A two-element vector containing the colors of the plotted bars. Defaults to c("blue", "orange") |
plot_titles |
A vector of titles for the plots |
model_names |
A vector of names for the individual models |
xaxis_range |
A maximum value for the x-axis |
standard_xaxis |
If TRUE, the x-axis on all graphs will be the same. If FALSE, it will adjust to fit each individual graph. Defaults to TRUE. |
flip_graphs |
Flips the graphs horizontally. Defaults to FALSE (low-value outcome variable on the left, high-value outcome variable on the right) |
print_individual |
If TRUE, prints an individual graph for each model. Defaults to TRUE. |
print_summary |
If TRUE, prints a summary graph with all models. Defaults to TRUE. |
Nothing (this function plots a series of graphs)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | strong_movie_review_data$cleanText = clean_text(strong_movie_review_data$text)
mild_movie_review_data$cleanText = clean_text(mild_movie_review_data$text)
# Using language to predict "Positive" vs. "Negative" reviews
# Only for strong reviews (ratings of 1 or 10)
movie_model_strong = language_model(strong_movie_review_data,
outcome = "valence",
outcomeType = "binary",
text = "cleanText",
progressBar = FALSE)
# Using language to predict "Positive" vs. "Negative" reviews
# Only for mild reviews (ratings of 4 or 7)
movie_model_mild = language_model(mild_movie_review_data,
outcome = "valence",
outcomeType = "binary",
text = "cleanText",
progressBar = FALSE)
# Analyze ROC curves
plot_predictor_words(movie_model_strong, movie_model_mild)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.