小编OTA*_*OTA的帖子

How do you keep the first value in multiple columns?

I have a dataframe. I want to keep the first value in multiple columns.

I prefer a tidyverse solution using the pipe %>% operator. I prefer a solution where I can input E1:N3 because I have about 50 columns in the real dataset.

This is the dataframe:

df <- data.frame(age = c(20, 25, 30), E1 = c("1 Alpha", "2 Bravo", "1 Alpha"), E2 = c("2 Bravo", "2 Bravo", "2 Bravo"), E3 = c("1 Alpha", "2 Bravo", "2 Bravo"), N1 = …
Run Code Online (Sandbox Code Playgroud)

r dplyr

6
推荐指数
1
解决办法
48
查看次数

tidymodels: ranger with cross validation

The dataset can be found here: https://www.kaggle.com/mlg-ulb/creditcardfraud

I am trying to use tidymodels to run ranger with 5 fold cross validation on this dataset.

I have have 2 code blocks. The first code block is the original code with the full data. The second code block is almost identical to the first code block, except I have subset a portion of the data so the code runs faster. The second block of code is just to make sure my code …

r tidymodels

6
推荐指数
1
解决办法
1132
查看次数

标签 统计

r ×2

dplyr ×1

tidymodels ×1