XGBoost Classifier
Describe your change:
- [x] Add an algorithm?
- [ ] Fix a bug or typo in an existing algorithm?
- [ ] Documentation change?
Checklist:
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized.
- [x] I know that pull requests will not be merged if they fail the automated tests.
- [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
- [x] All new Python files are placed inside an existing directory.
- [x] All filenames are in all lowercase characters with no spaces or dashes.
- [x] All functions and variable names follow Python naming conventions.
- [x] All function parameters and return values are annotated with Python type hints.
- [x] All functions have doctests that pass the automated testing.
- [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
- [x] If this pull request resolves one or more open issues then the commit message contains
Fixes: #{$ISSUE_NO}.
@cclauss Can you please review this I hope this will be merged as all the tests are passing.
Your only function, main() takes no inputs and returns no outputs and it plots. This is not an algorithm by this repo's definition.
https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md#what-is-an-algorithm
What is an Algorithm?
An Algorithm is one or more functions (or classes) that:
- take one or more inputs,
- perform some internal calculations or data manipulations,
- return one or more outputs,
- have minimal side effects (Ex.
print(),plot(),read(),write()).
But there are algorithms which already exists in your repo that do not return output. The output is the graph it plots. The algorithm does takes input at line 28 for training. It's a machine learning algorithm.
Why not open a pull request here? https://github.com/dmlc/xgboost/tree/master/demo They probably want how-to-use examples. We want to focus on algorithms.
This algorithm does not have any functions at all but it is there in this repository.
Yes. That was merged 1,196 days ago and we have raised our standards for new submissions significantly since then. There are lots of repos that are easier to contribute to.
Your only function,
main()takes no inputs and returns no outputs and it plots. This is not an algorithm by this repo's definition.https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md#what-is-an-algorithm
What is an Algorithm?
An Algorithm is one or more functions (or classes) that:
- take one or more inputs,
- perform some internal calculations or data manipulations,
- return one or more outputs,
- have minimal side effects (Ex.
print(),plot(),read(),write()).
@cclauss I have edited the script according to the deifinition os this repo now
@cclauss Hello it's been 5 day since I made the changes can you review this PR whenever you get time. Thank You
These are type hints. If your function parameters do not have them then your pull request will not be reviewed and it will not be merged.
These are doctests. If your functions do not have them then your pull request will not be reviewed and it will not be merged.
Please read CONTRIBUTING.md for details.
OK. I have added better names and wrapped long lines to placate pre-commit.
The only test that fails is one that I do not know how to solve.
Please click the Details button on the line with the ❌ below to see the error. You can run these tests on your own machine with the command: python3 -m doctest -v machine_learning/xgboostclassifier.py
UNEXPECTED EXCEPTION: ValueError('Invalid classes inferred from unique values of y. Expected: [0 1], got [1 2]')
OK. I have added better names and wrapped long lines to placate pre-commit.
The only test that fails is one that I do not know how to solve.
Please click the
Detailsbutton on the line with the ❌ below to see the error. You can run these tests on your own machine with the command:python3 -m doctest -v machine_learning/xgboostclassifier.pyUNEXPECTED EXCEPTION: ValueError('Invalid classes inferred from unique values of
y. Expected: [0 1], got [1 2]')
Thank you very much. That's so kind of you.
@cclauss Thank you with your help I removed the errors.
Thanks massively for your persistence!!!
Thank you for your guidance and help.