You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Attributes that have been estimated from the data must always have a name ending with trailing underscore, for example the coefficients of some regression estimator would be stored in a coef_ attribute after fit has been called."
Those attributes can be easily obtained like so:
attribute_keys = [
key
for key in dir(model)
if key.endswith("_")
and not key.endswith("__")
]
However, in some estimators, we need other attributes that do not follow this convention to use predict/transform methods, like _n_threads in KMeans or _predict_1d and _x_mean in PLSRegression.
To circumvent this, we use a 'nearly all-in' approach that collects many other attributes we do not need in the final JSON file.
To maintain functionality while reducing the serialization of unnecessary attributes, we can build an exception dictionary collecting estimator attribute exceptions for each estimator.
The text was updated successfully, but these errors were encountered:
According to sklearn:
"Attributes that have been estimated from the data must always have a name ending with trailing underscore, for example the coefficients of some regression estimator would be stored in a
coef_
attribute afterfit
has been called."Those attributes can be easily obtained like so:
However, in some estimators, we need other attributes that do not follow this convention to use predict/transform methods, like
_n_threads
in KMeans or_predict_1d
and_x_mean
in PLSRegression.To circumvent this, we use a 'nearly all-in' approach that collects many other attributes we do not need in the final JSON file.
To maintain functionality while reducing the serialization of unnecessary attributes, we can build an exception dictionary collecting estimator attribute exceptions for each estimator.
The text was updated successfully, but these errors were encountered: