Description
RffTransform
has an undesirable coupling to which kind of MatrixGenerator it is using (gaussian or not).
machinelearning/src/Microsoft.ML.Transforms/RffTransform.cs
Lines 421 to 425 in e77f24e
It is using the ComponentCatalog to determine which type of MatrixGenerator it was working with before actually creating it. And then depending on the Type, it is doing a different distance scaling algorithm.
This type of decision (which algorithm to use for distance scaling) should be done by the MatrixGenerator itself, and not necessarily decided by the RffTransform.
I am changing RffTransform to no longer use SubComponent. However, I can no longer tell which type of MatrixGenerator is going to be created without actually creating the generator, so I needed to make a "dummy" instance. I spoke with @yaeldekel, and we decided this was "OK" for now, since it typically only used with a small number of columns (i.e. 1).
We should consider refactoring RffTransform and the IFourierDistributionSampler types to allow RffTransform to not have to switch based on whether Gaussian sampling is used or not.