<jupyter_start><jupyter_text>Quick Start with XGBoost https://xgboost.readthedocs.io/en/latest/get_started.html - Advanced Library for Boosted Trees.- GPU Support.- Can help you win a Kaggle Competition.- Can deploy ML products.<jupyter_code>!pip install xgboost<jupyter_output>Requirement already satisfied: xgboost in /usr/local/lib/python3.6/dist-packages (0.90)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from xgboost) (1.3.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from xgboost) (1.17.4)<jupyter_text>Quick Tutorial<jupyter_code>import xgboost as xgb<jupyter_output><empty_output><jupyter_text>- XGBoost uses Data Matrix as an internal data structure for fast computing.- It can be constructed using numpy arrays as well - For a Binary Classification task we can quickly use XGB as follows<jupyter_code>dtrain = xgb.DMatrix('demo/data/agaricus.txt.train')
dtest = xgb.DMatrix('demo/data/agaricus.txt.test')
# Specify the parameters via map 
param = {'max_depth': 2, 'eta': 1, 'objective': 'binary:logistic'}
num_rounds = 2
bst = xgb.train(params=param, dtrain = dtrain, num_boost_round=num_rounds)
preds = bst.predidct(dtest)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11066235864297254, 'fraction_numerical': 0.015347334410339256, 'mean_word_length': 5.921787709497207, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '377397', 'license': 'MIT', 'n_tokens_mistral': 440, 'n_tokens_neox': 420, 'n_words': 110, 'path': 'Learning_XGBoost/XGBoost_Intro.ipynb', 'repo_name': 'oke-aditya/Machine_Learning', 'size': '1238'}