New answers tagged

0

The Solution that I have found: y <- ts(data$VALORE, frequency = 24, start = 1) train <- ts(y[1:12264], frequency=24) #70% val <- ts(y[12265:17520], frequency=24) #30%


0

Description It is possible to write ASCII text representation of an R object with the use of dput, dump, dget and source. And with this it is possible to preserve the class information Method saving the file to save the file use the dget and/or dump function, and to make sure that the file preserve the class information use the argument control = "all&...


2

The best way to achieve this would be to save the data as an R data file using either save() or saveRDS(): # option 1 save(df, file="data.Rdata") load("data.Rdata") # option 2 saveRDS(df, file="data2.Rds") df <- readRDS("data2.Rds")


1

This doesn't seem like a great task for regex--even your pattern would miss very close typos like COWID-19 or potential OCR mistakes like C0VID-I9. Instead, I'd suggest using the stringdist package to do fuzzy matching, perhaps stringdist::afind to find approximate matches of "COVID-19". You can read a bit about it here. This will let you select ...


1

Thank you for providing a good reproducible code, I can't resist answering the question :) Hope the following code helps: data <- read.table(text = "0 1 2 3 4 5 MR 155 211 64 14 1 1 Mob 0 393 51 2 0 0 SC 0 427 12 7 0 0 Act 0 386 45 15 0 0 Pain 0 379 62 5 0 0 Anx 0 355 73 18 0 0", header = TRUE)...


1

Wouldn't remove similar looking observations unless you have a strong reason to do so. By deleting similar looking observations you may be adding bias into the underlying distribution responsible for generating the data. Your model may be misled into learning a biased distribution and that may affect final performance. To start with use the entire dataset as ...


1

Below are two functions using my favorite packages: The first one shows a scatterplot of every column against the target column The second one shows the correlation of every column with the target column, with confidence intervals (I found how to do that with ggplot here). Code: library(ggplot2) library(reshape2) library(plyr) scatterplot <- function(...


0

library(tidymodels) xgboost_set <- param_set(list(learn_rate(range = c(0.01,0.3), trans = NULL), trees(range = c(200,1000), trans = NULL), #trees(): The number of trees contained in a random forest or boosted ensemble. In the latter case, this is equal to the number of boosting iterations ...


1

Would something like this work? I simply add an extra column that indicates the row number (which is later used as the x-axis) to make sure all values are displayed as a new point instead of plotting on top of each other for the same day. I then specifiy the custom x ticks and labels by selecting the first row for each day and get the row number (which ...


0

dials from Tidymodels has a grid_latin_hypercube function you can use for this https://dials.tidymodels.org/reference/grid_max_entropy.html


1

Update: It was only a matter of transform string numbers in numerical numbers. I did it by transforming each "non numeric" column in character and used the as.numeric(). The code looks like this now: #Nomes das colunas names(df)[2] = 'Produçãox1' names(df)[3] = 'Produçãox2' names(df)[4] = 'Remuneraçãoy1' names(df)[5] = 'Remuneraçãoy2' df$...


Top 50 recent answers are included