Skip to content
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

better way to initialize LinearRegression with params #464

Open
mathause opened this issue Jun 13, 2024 · 0 comments
Open

better way to initialize LinearRegression with params #464

mathause opened this issue Jun 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mathause
Copy link
Member

Creating a new LinearRegression instance is a bit awkward as the params have to be assigned in a separate call.

lr = LinearRegression()
lr.params = params

We should enable a better approach. I see 3 options. I probably have a slight preference for option 2, but no strong opinion.

Option 1

Allow passing params to __init__:

lr = LinearRegression(params)

Option 2

Create a classmethod

lr = LinearRegression.from_params(params)

See

@classmethod
def from_netcdf(cls, filename, **kwargs):

Option 3

Split the class into methods...

@veni-vidi-vici-dormivi veni-vidi-vici-dormivi added the enhancement New feature or request label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants