-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Polynomial regression to predict time (tqdm_regress, tsrange) #248
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
base: master
Are you sure you want to change the base?
Conversation
tqdm module to predict time using machine learning polynomial regression Signed-off-by: Stephen L. <lrq3000@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #248 +/- ##
=========================================
Coverage ? 64.29%
=========================================
Files ? 8
Lines ? 759
Branches ? 148
=========================================
Hits ? 488
Misses ? 270
Partials ? 1
Continue to review full report at Codecov.
|
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
PS: if you are wondering whether we could implement analytical regression with numpy, the answer is: not by ourselves, way too much complicated because we would have to reimplement a lot of linear algebra on matrices. There is however a pure python library called PyLA that did all that and even features a least square linear regression function (a solve function but it's basically the same), so we could use that, but we would still rely on a third-party library (although pure python) and it would be a lot slower than numpy. |
Ah maybe we could implement an additional algorithm (Moving average regression model) as pointed here: #48 (comment) |
@lrq3000 By default the "regression mode" is linear. This one implements polynomial - perhaps exponential should also be implemented? |
@CrazyPython Exponential is implemented, just use |
@lrq3000 oh linear = regular tqdm. put it in README? |
@CrazyPython Not exactly, normal |
Tag help-wanted for unit tests. |
@CrazyPython No need, I can make them, I can recycle my testing code into unit tests + already done unit tests for machine learning libraries, so it won't be too hard, but it's time consuming, so I'll do that only if this module has an audience. |
@lrq3000 aye, is linting really so hard that you have to put it on the TODO? My editor (pcyharm) has it built-in w/ a simple keyboard shortcut. |
I don't use an IDE but a simple text editor notepad++, and my default font
|
@lrq3000 Oh god you have no idea the joys of PyCharm. I used to use IDLE (notepad + indentation + shortcuts for running and embedded interactive shell), and looking back, it was pretty horrible. PyCharm is a really "smart" IDE. If you use a PyCharm Community Edition is free and open source. Inspections can be disabled/enabled at will. Easy to start using. |
8cade97
to
a65e347
Compare
6ec00f1
to
4b6476a
Compare
fixes #206, should go into a |
Add tqdm module to predict time using machine learning polynomial regression.
Implementation of what was asked in #206.
For memory, here is the model used in this implementation to predict time using machine learning polynomial regression:
Canonical example:
Uncomment the other
tt = ...
lines if you want to try the different algorithms provided.There are three different algorithms provided:
Ok so basically how it works:
(n=current iteration, elapsed)
is generated.Note on the implementation: all this is done in
format_meter()
for two reasons:__iter__()
andupdate()
.Please try it out and tell me if it fits your need and if it works well (don't hesitate to play with the parameters, they are explained in the docstring of
tqdm_regress
). I will finish the TODO after received feedback.TODO: