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

linear regression: non dimension coords along dim end up in params #333

Closed
mathause opened this issue Nov 13, 2023 · 0 comments · Fixed by #334
Closed

linear regression: non dimension coords along dim end up in params #333

mathause opened this issue Nov 13, 2023 · 0 comments · Fixed by #334
Labels
bug Something isn't working topic-stats

Comments

@mathause
Copy link
Member

data_1D.year ends up in lr.params - but they should not

import mesmer
import mesmer.testing

data_1D = mesmer.testing.trend_data_1D()
data_1D = data_1D.assign_coords(year=("time", data_1D.time.values + 1850))

lr = mesmer.stats.linear_regression.LinearRegression()
lr.fit({"not_time": data_1D["time"]}, data_1D, dim="time")
lr.params
<xarray.Dataset>
Dimensions:        (time: 30)
Coordinates:
    year           (time) int64 1850 1851 1852 1853 1854 ... 1876 1877 1878 1879
Dimensions without coordinates: time
Data variables:
    intercept      float64 -0.07344
    not_time       float64 0.9967
    fit_intercept  bool True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic-stats
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant