-
Notifications
You must be signed in to change notification settings - Fork 5
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
LinearModel: precise output type of predict() fnc #1479
base: master
Are you sure you want to change the base?
Conversation
From the doctring, I think you can guanratee return of series by setting 'squeeze_single_row_output' to False. |
Hi @EvaJanouskova - as @tbhallett said I think the |
Thank you, @tbhallett and @matt-graham, it is working. Still shouldn't the declaration reflect that it may sometimes return different type? Smt like -> Unit[pd.Series, np.bool]? |
And if |
@EvaJanouskova you're right that the current type annotation is a bit misleading (though this won't have any functional effect) - I think |
@matt-graham, What I meant is that it returns |
If Lines 454 to 463 in 8d0cfee
The |
what about in this case: Lines 439 to 442 in 8d0cfee
|
The |
Ah, yeah. I can see it now, thank you @matt-graham. |
…t type when False
I'm getting an error, because the predict() fnc does in some cases return numpy.bool instead of pd.Series.
(I've added assert in here to point it out.) Could we change the function to return pd.Series in all cases as declared when the function defined?