-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
XGBoost Classifier #7106
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
Merged
Merged
XGBoost Classifier #7106
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
1bd7304
Fixes: #{6551}
Moddy2024 8990641
Update xgboostclassifier.py
Moddy2024 5feb35b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a927e97
Update xgboostclassifier.py
Moddy2024 aaaf398
Update xgboostclassifier.py
Moddy2024 06a9025
Update xgboostclassifier.py
Moddy2024 0decdf8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d795ac4
Fixes: #{6551}
Moddy2024 e16b32b
Update xgboostclassifier.py
Moddy2024 f797b34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bd88865
Update xgboostclassifier.py
Moddy2024 3cbd77b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 06b6981
Update xgboostclassifier.py
Moddy2024 0519814
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bc690dd
Update xgboostclassifier.py
Moddy2024 3b899b1
Fixes : #6551
Moddy2024 8c111ca
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 08cf249
Fixes : #6551
Moddy2024 c282905
Fixes : #6551
Moddy2024 776162d
Fixes: #6551
Moddy2024 93f1c64
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 49a6223
Update xgboostclassifier.py
Moddy2024 147bfd4
Update xgboostclassifier.py
Moddy2024 4451683
Update xgboostclassifier.py
Moddy2024 489822d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 844b4be
Fixes: #6551
Moddy2024 79603f7
Fixes #6551
Moddy2024 5751029
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9e77f64
Fixes: {#6551}
Moddy2024 0ccc63f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f44646b
Fixes: {#6551}
Moddy2024 ccf61cd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9c0bbff
Fixes: #6551
Moddy2024 34d7dc3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6d13459
FIXES: {#6551}
Moddy2024 80d86c1
Fixes : { #6551}
Moddy2024 5f9cae8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 22d8913
Fixes : { #6551}
Moddy2024 3f36987
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a357282
Fixes: { #6551]
Moddy2024 ae11a52
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8a42329
Update xgboostclassifier.py
Moddy2024 d9cded2
Update xgboostclassifier.py
Moddy2024 682943f
Apply suggestions from code review
cclauss 0de2c82
Update xgboostclassifier.py
cclauss d04fd28
Update xgboostclassifier.py
cclauss 2c7f99c
Update xgboostclassifier.py
Moddy2024 1f3affb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 307122f
Fixes: { #6551}
Moddy2024 7d42c2e
Update xgboostclassifier.py
Moddy2024 32a5206
Fixes: { #6551}
Moddy2024 32091d3
Update xgboostclassifier.py
Moddy2024 98dc009
Fixes: ( #6551)
Moddy2024 6496c2c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c78ede9
Fixes: { #6551}
Moddy2024 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- coding: utf-8 -*- | ||
"""xgboostclassifier.ipynb | ||
|
||
Automatically generated by Colaboratory. | ||
|
||
Original file is located at | ||
https://colab.research.google.com/drive/1UlMmSrfKLuRW9LPCz6BvDDJMPgPhO-yu | ||
""" | ||
|
||
# XGBoost Classifier Example | ||
from matplotlib import pyplot as plt | ||
from sklearn.datasets import load_iris | ||
from xgboost import XGBClassifier | ||
from sklearn.metrics import plot_confusion_matrix | ||
from sklearn.model_selection import train_test_split | ||
|
||
|
||
def main(): | ||
Moddy2024 marked this conversation as resolved.
Show resolved
Hide resolved
Moddy2024 marked this conversation as resolved.
Show resolved
Hide resolved
Moddy2024 marked this conversation as resolved.
Show resolved
Hide resolved
Moddy2024 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
""" | ||
The Url for the algorithm | ||
https://xgboost.readthedocs.io/en/stable/ | ||
Iris type dataset is used to demonstrate algorithm. | ||
""" | ||
|
||
# Load Iris dataset | ||
iris = load_iris() | ||
|
||
# Split dataset into train and test data | ||
x = iris["data"] # features | ||
y = iris["target"] | ||
x_train, x_test, y_train, y_test = train_test_split( | ||
x, y, test_size=0.3, random_state=1 | ||
) | ||
|
||
# XGBoost Classifier | ||
xgb = XGBClassifier() | ||
xgb.fit(x_train, y_train) | ||
|
||
# Display Confusion Matrix of Classifier | ||
plot_confusion_matrix( | ||
xgb, | ||
x_test, | ||
y_test, | ||
display_labels=iris["target_names"], | ||
cmap="Blues", | ||
normalize="true", | ||
) | ||
plt.title("Normalized Confusion Matrix - IRIS Dataset") | ||
plt.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.