-
Notifications
You must be signed in to change notification settings - Fork 2
Sphinx setup, documentation for estimators.py, evaluators.py #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I like the TODOs you are putting into the code.
I like the typing, but I'm also okay if there are some things that are not typed yet if they are hard to type - perhaps some re-design could help in those situtations?
RegressionStatisticalResults | ||
Linear coefficient statistics for this estimator. | ||
""" | ||
# TODO should we not check that dof_, t_ p_ are fitted as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
class RegressionStatisticalResults(NamedTuple): | ||
"""Statistical results object for linear regressors. | ||
TODO should this be private? Only used internally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes probably, especially if this results object is never returned or accessed by a user
This is a method of :class:`~sklearn.base.BaseEstimator`. | ||
TODO make deep argument functional. | ||
I believe this implementation could be replaced with the class's default implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so that it's possible to update each component of a nested object. | ||
TODO I believe this could be replaced with the base class's implementation | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - it seems like this is not necessary anymore for newer versions of scikit learn
# an sklearn Scorer takes an estimator, X and optional y, and returns a scalar score | ||
# https://scikit-learn.org/stable/modules/generated/sklearn.metrics.make_scorer.html#sklearn.metrics.make_scorer | ||
Scorer = Callable[[Estimator, Optional[npt.ArrayLike]], Score] | ||
ScoreEvaluation = Dict[str, List[Score]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10/10 for effort - though I think we've lost this battle in python...
|
||
scores = defaultdict(list) | ||
if self.groupby is not None: | ||
# TODO: this makes X/y implicitly a dataframe. Is this intended? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this seems like a code smell to me - good catch. I think we should make a good fix for this... I suspect this happens throughout the code. IT may be fixed by assuming everything is a DataFrame? When would we not use a DataFrame?
Apologies for the large pull request.
This contains:
Many type hints are updated/added as this has been relatively free given I have been going through the codebase.
I do not expect these hints to fully pass mypy, but should at least aid any future attempt to do so