juliasilge.com | My blog , built with blogdown and Hugo link | Static Site Generator library
kandi X-RAY | juliasilge.com Summary
kandi X-RAY | juliasilge.com Summary
This blog is built with blogdown and Hugo, with the Academic theme. I deploy my blog using Netlify. My blog posts are released under a Creative Commons Attribution-ShareAlike 4.0 International License.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of juliasilge.com
juliasilge.com Key Features
juliasilge.com Examples and Code Snippets
Community Discussions
Trending Discussions on juliasilge.com
QUESTION
I am trying to follow this tutorial here - https://juliasilge.com/blog/xgboost-tune-volleyball/
I am using it on the most recent Tidy Tuesday dataset about great lakes fishing - trying to predict agency based on many other values.
ALL of the code below works except the final row where I get the following error:
...ANSWER
Answered 2021-Jun-15 at 04:08If we look at the documentation of last_fit() We see that split
must be
An rsplit object created from `rsample::initial_split().
You accidentally passed the cross-validation folds object stock_folds
into split
but you should have passed rsplit
object stock_split
instead
QUESTION
I am creating a box plot in which I have used scale_x_reordered() after adjusting the order of factors on the x axis.
I am now trying to change the label of one factor. I had previously been doing this using:
scale_x_discrete(labels=c("old_label" = "new_label"))
However, I cannot use both scale_x_discrete() and scale_x_reordered() in the same plot. Does anyone know of a fix so that I can change a label and keep scale_x_reordered?
My ggplot is based off of this very helpful example: linked here
The change I am trying to make is equivalent to manually changing the name "Michael" to "Mike".
...ANSWER
Answered 2021-Jun-04 at 12:17To achieve your desired result I would suggest to recode your factor before applying reorder_within
.
The reason is that reorder_within
transforms the factor levels to make the reordering within facets work. Inside scale_x_reordered
a re-transformation is applied via the labels
argument to show the original levels or labels. That's why you can't make use of the labels
argument.
In the following example taken from the link you posted I make use of dplyr::recode(name, "Michael" = "Mike")
just before reorder_within
:
QUESTION
I have trained and tested a random forest model in R using tidymodels. Now i want to use the same model to predict a completely new dataset (not the training dataset).
For example Julia silge, had explained the steps to train, test and evaluate a model in this blog post : Juliasilge's palmer penguins. I wanted to apply this model on a completely new dataset with same columns (except the prediction column(here sex))
Can anyone help me with the code for predicting on a new dataset.
I can explain what i have tried with a sample dataset
...ANSWER
Answered 2021-May-05 at 18:19The problem in your code is you are trying to fit the final model on new data which lacks the target variable sex
this is what the error is telling you.
QUESTION
I've recently been using tidymodels to run models and select parameters that best satisfy some objective function. For example using a hypothetical regression on mtcars data (using the regression examples from the bottom answer of this question as an example)
...ANSWER
Answered 2021-Feb-09 at 21:57There is an experimental package we are developing to do just this called workflowsets. You can install it from GitHub for now, if you are up for trying out a new, still-developing package:
QUESTION
I am using the reorder_within() function from the tidytext package in R to make a plot of different frequencies. An analogous example comes from here.
...ANSWER
Answered 2020-Sep-22 at 21:40In contrast to the solutions in the answer linked by @tamtam, here is a solution that requires minimal overhead: You can use ggtext::element_markdown
to interpret any text in the ggplot as markdown. Just add axis.text.y = ggtext::element_markdown()
and all variable names that have the form "**Name**"
are shown in bold:
QUESTION
Having a dataframe like this:
...ANSWER
Answered 2020-Feb-04 at 12:11You can use the following code
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install juliasilge.com
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page