-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Forecast #3219
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
Forecast #3219
Conversation
@dhruvmanila please review my code |
machine_learning/forecasting/run.py
Outdated
from statsmodels.tsa.statespace.sarimax import SARIMAX | ||
|
||
|
||
def lin_reg_pred(train_dt, train_usr, train_mtch, test_dt, test_mtch): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints? Doctests? See CONTRIBUTING.md.
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 85c68050-0cfd-11eb-b943-5b98ff54aa42 |
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 16dd23f0-0cfe-11eb-b943-5b98ff54aa42 |
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 7e48c830-0d3c-11eb-9111-f326d0cb7f09 |
machine_learning/forecasting/run.py
Outdated
return prediction | ||
|
||
|
||
def sarimax_predictor(train_user, train_match, test_match): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints?
machine_learning/forecasting/run.py
Outdated
return result[0] | ||
|
||
|
||
def support_machine_regressor(x_train, x_test, train_user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints?
machine_learning/forecasting/run.py
Outdated
return y_pred[0] | ||
|
||
|
||
def interquartile_range_checker(train_user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints?
machine_learning/forecasting/run.py
Outdated
return low_lim | ||
|
||
|
||
def data_safety_checker(list_vote, actual_result): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arent the hints input and output that i described??
or did i do it wrongly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.python.org/3/library/typing.html is described in CONTRIBUTING.md. Or look at other Python files in this repo.
machine_learning/forecasting/run.py
Outdated
|
||
|
||
# data_input_df = pd.read_csv("ex_data.csv", header=None) | ||
list_data = [[18231, 0.0, 1], [22621, 1.0, 2], [15675, 0.0, 3], [23583, 1.0, 4]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide a more self-documenting variable name than list_data
. What is this a list of? Are these stock quotes or swine flu patients or food orders? Help the reader understand what this data is so they can understand why all this analysis is worth doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, please check it if the current one can be used or not
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 58799020-0d3d-11eb-9111-f326d0cb7f09 |
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: e46d8140-0d3d-11eb-9111-f326d0cb7f09 |
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 52649e50-0d51-11eb-9111-f326d0cb7f09 |
Travis tests have failedHey @nandiya, TravisBuddy Request Identifier: 609ea0a0-0d52-11eb-9111-f326d0cb7f09 |
@cclauss i'm still confuse with the hints that u were mentioned, since in contributing.md only described normal input and output |
From CONTRIBUTING.md: The use of Python type hints is encouraged for function parameters and return values. Our automated testing will run mypy so run that locally before making your submission. def sum_ab(a: int, b: int) -> int:
return a + b |
@cclauss done changing that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints on data_safety_checker() please.
machine_learning/forecasting/run.py
Outdated
from statsmodels.tsa.statespace.sarimax import SARIMAX | ||
|
||
|
||
def lin_reg_pred( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def lin_reg_pred( | |
def linear regression_prediction( |
Don't make the reader guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
machine_learning/forecasting/run.py
Outdated
prediction = abs(beta[0] + test_dt[0] * beta[1] + test_mtch[0] + beta[2]) | ||
return prediction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prediction = abs(beta[0] + test_dt[0] * beta[1] + test_mtch[0] + beta[2]) | |
return prediction | |
return abs(beta[0] + test_dt[0] * beta[1] + test_mtch[0] + beta[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
machine_learning/forecasting/run.py
Outdated
return result[0] | ||
|
||
|
||
def support_machine_regressor(x_train: list, x_test: list, train_user: list) -> float: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def support_machine_regressor(x_train: list, x_test: list, train_user: list) -> float: | |
def support_vector_regressor(x_train: list, x_test: list, train_user: list) -> float: |
Matches the docstring on the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
machine_learning/forecasting/run.py
Outdated
if safe > not_safe: | ||
print("today's data is safe") | ||
else: | ||
print("today's data is not safe") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if safe > not_safe: | |
print("today's data is safe") | |
else: | |
print("today's data is not safe") | |
print("today's data is {'not ' if safe <= not_safe else ''}safe") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk whether that code is working, but i got ur point to use inline if print
--done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your persistence!
* add forecasting code * add statsmodel * sort import * sort import fix * fixing black * sort requirement * optimize code * try with limited data * sort again * sort fix * sort fix * delete warning and black * add code for forecasting * use black * add more hints to describe * add doctest * finding whitespace * fixing doctest * delete * revert back * revert back * revert back again * revert back again * revert back again * try trimming whitespace * try adding doctypeand etc * fixing reviews * deleting all the space * fixing the build * delete x * add description for safety checker * deleting subscription integer * fix docthint * make def to use function parameters and return values * make def to use function parameters and return values * type hints on data safety checker * optimize code * Update run.py Co-authored-by: FVFYK3GEHV22 <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* add forecasting code * add statsmodel * sort import * sort import fix * fixing black * sort requirement * optimize code * try with limited data * sort again * sort fix * sort fix * delete warning and black * add code for forecasting * use black * add more hints to describe * add doctest * finding whitespace * fixing doctest * delete * revert back * revert back * revert back again * revert back again * revert back again * try trimming whitespace * try adding doctypeand etc * fixing reviews * deleting all the space * fixing the build * delete x * add description for safety checker * deleting subscription integer * fix docthint * make def to use function parameters and return values * make def to use function parameters and return values * type hints on data safety checker * optimize code * Update run.py Co-authored-by: FVFYK3GEHV22 <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* add forecasting code * add statsmodel * sort import * sort import fix * fixing black * sort requirement * optimize code * try with limited data * sort again * sort fix * sort fix * delete warning and black * add code for forecasting * use black * add more hints to describe * add doctest * finding whitespace * fixing doctest * delete * revert back * revert back * revert back again * revert back again * revert back again * try trimming whitespace * try adding doctypeand etc * fixing reviews * deleting all the space * fixing the build * delete x * add description for safety checker * deleting subscription integer * fix docthint * make def to use function parameters and return values * make def to use function parameters and return values * type hints on data safety checker * optimize code * Update run.py Co-authored-by: FVFYK3GEHV22 <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* add forecasting code * add statsmodel * sort import * sort import fix * fixing black * sort requirement * optimize code * try with limited data * sort again * sort fix * sort fix * delete warning and black * add code for forecasting * use black * add more hints to describe * add doctest * finding whitespace * fixing doctest * delete * revert back * revert back * revert back again * revert back again * revert back again * try trimming whitespace * try adding doctypeand etc * fixing reviews * deleting all the space * fixing the build * delete x * add description for safety checker * deleting subscription integer * fix docthint * make def to use function parameters and return values * make def to use function parameters and return values * type hints on data safety checker * optimize code * Update run.py Co-authored-by: FVFYK3GEHV22 <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.