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.
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): |
machine_learning/forecasting/run.py
Outdated
| return result[0] | ||
|
|
||
|
|
||
| def support_machine_regressor(x_train, x_test, train_user): |
machine_learning/forecasting/run.py
Outdated
| return y_pred[0] | ||
|
|
||
|
|
||
| def interquartile_range_checker(train_user): |
machine_learning/forecasting/run.py
Outdated
| return low_lim | ||
|
|
||
|
|
||
| def data_safety_checker(list_vote, actual_result): |
There was a problem hiding this comment.
arent the hints input and output that i described??
or did i do it wrongly?
There was a problem hiding this comment.
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.
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.
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 |
cclauss
left a comment
There was a problem hiding this comment.
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.
| def lin_reg_pred( | |
| def linear regression_prediction( |
Don't make the reader guess.
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.
| 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]) |
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.
| 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.
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.
| 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.
idk whether that code is working, but i got ur point to use inline if print
--done
* 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 <fvfyk3gehv22@FVFYK3GEHV22s-MacBook-Pro.local> Co-authored-by: Christian Clauss <cclauss@me.com>
* 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 <fvfyk3gehv22@FVFYK3GEHV22s-MacBook-Pro.local> Co-authored-by: Christian Clauss <cclauss@me.com>
* 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 <fvfyk3gehv22@FVFYK3GEHV22s-MacBook-Pro.local> Co-authored-by: Christian Clauss <cclauss@me.com>
* 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 <fvfyk3gehv22@FVFYK3GEHV22s-MacBook-Pro.local> Co-authored-by: Christian Clauss <cclauss@me.com>

Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.