Answers for "r - scale data from 0 to 1"

0

r - scale data from 0 to 1

s = sort(rexp(100)) # Generate 100 values of exponential distribution
range01 <- function(x){(x-min(x))/(max(x)-min(x))} # Function MinMax Scaler
range01(s) # Calculate scaleing from 0 to 1
Posted by: Guest on June-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language