I am trying to implement Standard Scalar, where I have to store my mean and standard deviation of training data and use that mean and std_dev in the test set.
function standard_scalar!(X, scaled_out)
mean = 1/length(X) * sum(X) std_dev = standard_deviation(X) for each in eachindex(X) scaled_out[each] = (X[each] - mean) / std_dev end
end
Since python is object oriented it is easier to create object which holds all these data.
Question
How to implement Standard Scalar like functions in Julia? I can return mean and std_dev from training and pass that to function when computing in test_set but that might not look good I feel…