security.masking.mask_estimator

security.masking.mask_estimator(estimator)

Return a non-sensitive string representation of an estimator.

Logs the estimator type without exposing its hyperparameters or any other configuration. This is the safe form to emit at INFO level when the actual estimator object may carry tuning details that should not be persisted in log aggregation systems (CWE-532).

Parameters

Name Type Description Default
estimator Any An estimator instance, an estimator name (string), or None. When None, the default project estimator label is returned. required

Returns

Name Type Description
str A short, safe string identifying the estimator family.

Examples

from spotforecast2_safe.security.masking import mask_estimator

mask_estimator(None)
'LGBMRegressor (default)'
mask_estimator("ForecasterRecursive")
'ForecasterRecursive'
from sklearn.linear_model import Ridge
mask_estimator(Ridge(alpha=42.0))
'Ridge'