I ran into a bug while testing the GRDF in the mat miner.featurizers.site module. The GeneralizedRadialDistributionFunction.from_preset defines bins using lambda functions in a loop, but they all take the final value instead of being defined with the value of the variable at each step of the loop. The lambda functions need to define a local variable instead of taking the variable from the outer scope to have the proper behavior.
This line of code: lambda d: np.exp(-width * (d - center)**2.)))
should be like this: lambda d**,**** center=center**: np.exp(-width * (d - center)**2.)))
and similarly for the lambda in the histogram preset.
However, with this bug fix, the default values for the preset (cutoff=10.0; width=0.5; spacing=0.5) produce the following error for Gaussian functions:
ValueError: Numerical integration does not play well with the chosen bin functionals, choose new ones.
Broader bin values of (cutoff=10.0; width=1.0; spacing=1.0) will run for both Gaussian and Histogram preset functions.
The Histogram preset does sometimes produce values of “inf” for some bins though, and I have not explored the cause of this behavior.