Add a new transform function that runs all available methods (boxcox, yeojohnson, etc) and goodness test and return the best one.
The API may look like this:
function transform(xs; kwargs...)
end
I think it's best to return an object that includes the transformed data & chisq result from all transformers.
"""
Transformation result for a single method - BoxCox, YeoJohnson, etc.
"""
struct TransformResult{T <: Real}
values::T
chisq::Float64
end
struct TransformationSummary{T <: Real}
results::Dict{NormalizeMethod, TransformationResult{T}}
end
Hence, transform function should return a TransformationSummary object. Then, we would have a function defined against TransformationSummary to pick the best one.
# Returns an array of values picked from the transformation results
function best_normalized(ts::TransformationSummary)
end
For now, let's just pass the keyword arguments along to all underlying transformers (BoxCox, YeoJohnson, etc.) For example, BoxCox takes α and scaled, and YeoJohnson takes any arguments that is accepted by Optim.optimize function. The caveat is that we may have collision of argument names across all transformers but let's not worry about that at this point.
Add a new
transform
function that runs all available methods (boxcox, yeojohnson, etc) and goodness test and return the best one.The API may look like this:
I think it's best to return an object that includes the transformed data & chisq result from all transformers.
Hence,
transform
function should return aTransformationSummary
object. Then, we would have a function defined againstTransformationSummary
to pick the best one.For now, let's just pass the keyword arguments along to all underlying transformers (BoxCox, YeoJohnson, etc.) For example, BoxCox takes
α
andscaled
, and YeoJohnson takes any arguments that is accepted byOptim.optimize
function. The caveat is that we may have collision of argument names across all transformers but let's not worry about that at this point.