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

BUG: LogisticRegression.fit has poor performance on speed #717

Open
JiaYaobo opened this issue Sep 24, 2023 · 2 comments
Open

BUG: LogisticRegression.fit has poor performance on speed #717

JiaYaobo opened this issue Sep 24, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@JiaYaobo
Copy link
Contributor

JiaYaobo commented Sep 24, 2023

Describe the bug

LogisticRegression.fit never stops with a bit larger data.

To Reproduce

When max_iter=1 everything works fine

from xorbits._mars.learn.glm import LogisticRegression
import numpy as np

n_rows = 100
n_cols = 2
X = np.random.randn(n_rows, n_cols)
y = np.random.randint(0, 2, n_rows)

lr = LogisticRegression(max_iter=1)
lr.fit(X, y)

However, just increase max_iter to 100, the program seems never stop (at least after 1min, it's weird.)

lr = LogisticRegression(max_iter=100)
lr.fit(X, y)
  1. Your Python version: 3.10.2
  2. The version of Xorbits you use: HEAD, install on my local device.
  3. I'm working on my Macbook with m1 pro chip
@XprobeBot XprobeBot added the bug Something isn't working label Sep 24, 2023
@XprobeBot XprobeBot modified the milestones: v0.6.3, v0.7.0 Sep 24, 2023
@JiaYaobo
Copy link
Contributor Author

After some inspection, mars-project/mars#2505 (comment) perhaps explain it, gradient based loop solution for logistic regression is inefficient for xorbits.

@JiaYaobo JiaYaobo changed the title BUG: LogisticRegression.fit never stops with a bit *larger* data. BUG: LogisticRegression.fit has poor performance on speed Sep 25, 2023
@XprobeBot XprobeBot modified the milestones: v0.7.0, v0.7.1 Oct 23, 2023
@luweizheng
Copy link
Contributor

Maybe we should use a different approach on the control flows, like for loop. For example, the method in this paper.

@XprobeBot XprobeBot modified the milestones: v0.7.1, v0.7.2 Nov 21, 2023
@XprobeBot XprobeBot modified the milestones: v0.7.2, v0.7.3 Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants