def METHOD_NAME(self):
    """Access first parameter in self, self inheriting from sklearn BaseForest.
    The attribute was renamed from base_estimator to estimator in sklearn 1.2.0.
    """
    import sklearn
    from packaging.specifiers import SpecifierSet
    sklearn_version = sklearn.__version__
    if sklearn_version in SpecifierSet(">=1.2.0"):
        return self.estimator
    else:
        return self.base_estimator