[R] How to make our data normally distributed in R
Rui Barradas
ru|pb@rr@d@@ @end|ng |rom @@po@pt
Thu Mar 12 23:51:39 CET 2020
Hello,
To rescale data so that their values are between 0 and 1, use this function:
scale01 <- function(x, na.rm = FALSE){
(x - min(x, na.rm = na.rm))/(max(x, na.rm = na.rm) - min(x, na.rm =
na.rm))
}
x <- c(SVM=3500,
ANN=4600,
R.Forest=2900)
scale01(x)
# SVM ANN R.Forest
#0.3529412 1.0000000 0.0000000
See base R function ?scale for another way of scaling data.
As for the second question, if your RMSE vector had values in the range
2900 to 4600 and the y axis limits are c(0, 1), how can you expect to
see anything?
Hope this helps,
Rui Barradas
Às 21:08 de 12/03/20, Neha gupta escreveu:
> Hi
>
> I have a regression based data where I get the RMSE results as:
>
> SVM=3500
> ANN=4600
> R.Forest=2900
>
> I want to know how can I make it so that its values comes as 0-1
>
> I plot the boxplot for it to indicate their RMSE values and used,
> ylim=(0,1), but the boxplot which works for RMSE values like 3500 etc, but
> when I use ylim=(0,1), all the boxplots suddenly disappears. What should I
> do for it?
>
> Thanks
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list