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

Get the number of iterations needed to train a model #277

Closed
Genarito opened this issue Jun 29, 2022 · 2 comments
Closed

Get the number of iterations needed to train a model #277

Genarito opened this issue Jun 29, 2022 · 2 comments

Comments

@Genarito
Copy link

Is your feature request related to a problem? Please describe.
I am doing some training time measurements of the FastKernelSurvivalSVM model. The problem is that I would like to know how much time it takes for each iteration, but I don't know this amount. It would be nice if the model has the attribute to be able to access it.

Describe the solution you'd like
Expose a new attribute (for example, n_iter, similarly to modern Scikit-Learn versions, where they added the n_iter_ attribute).

Describe alternatives you've considered
I'm accessing the number of iterations through the optimizer_result_ attribute:

estimator = FastKernelSurvivalSVM(rank_ratio=0.0, max_iter=1000, tol=1e-5)
# Trains the model...
estimator.optimizer_result_.nit

But I'm not really convinced if what I'm doing is right. It'd be cool to have an official solution.

Thanks in advance, this is a great lib ❤️

@sebp
Copy link
Owner

sebp commented Jun 30, 2022

You inferred it correctly, estimator.optimizer_result_.nit is what you want (see the scipy docs for details).

I agree that having an n_iter_ attribute would be useful to match sklearn.

@Genarito
Copy link
Author

Cool! Thank you very much!

sebp added a commit that referenced this issue Aug 13, 2022
sebp added a commit that referenced this issue Aug 13, 2022
@sebp sebp closed this as completed in 1a23bca Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants