资源简介

This book is your guide to fast gradient boosting in Python. You will discover the XGBoost Python library for gradient boosting and how to use it to develop and evaluate gradient boosting models. In this book you will discover the techniques, recipes and skills with XGBoost that you can then bring to your own machine learning projects. Gradient Boosting does have a some fascinating math under the covers, but you do not need to know it to be able to pick it up as a tool and wield it on important projects to deliver real value. From the applied perspective, gradient boosting is quite a shallow field and a motivated developer can quickly pick it up and start making very real and impactful contributions.

资源截图

代码片段和文件信息

# First XGBoost model for Pima Indians dataset
from numpy import loadtxt
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# load data
dataset = loadtxt(‘pima-indians-diabetes.csv‘ delimiter=““)
# split data into X and y
X = dataset[:0:8]
Y = dataset[:8]
# split data into train and test sets
seed = 7
test_size = 0.33
X_train X_test y_train y_test = train_test_split(X Y test_size=test_size random_state=seed)
# fit model on training data
model = XGBClassifier()
model.fit(X_train y_train)
# make predictions for test data
y_pred = model.predict(X_test)
predictions = [round(value) for value in y_pred]
# evaluate predictions
accuracy = accuracy_score(y_test predictions)
print(“Accuracy: %.2f%%“ % (accuracy * 100.0))

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     1236043  2017-12-04 00:19  xgboost_with_python.pdf
     目录           0  2017-12-04 00:19  code\
     目录           0  2017-12-04 00:19  code\chapter_08\
     文件       23279  2017-12-04 00:19  code\chapter_08\pima-indians-diabetes.csv
     文件        1120  2017-12-04 00:19  code\chapter_08\serialize_with_joblib.py
     文件        1121  2017-12-04 00:19  code\chapter_08\serialize_with_pickle.py
     目录           0  2017-12-04 00:19  code\chapter_06\
     文件         578  2017-12-04 00:19  code\chapter_06\stratified_cross_validation.py
     文件       23279  2017-12-04 00:19  code\chapter_06\pima-indians-diabetes.csv
     文件         777  2017-12-04 00:19  code\chapter_06\train_test_split.py
     文件         547  2017-12-04 00:19  code\chapter_06\cross_validation.py
     目录           0  2017-12-04 00:19  code\chapter_07\
     文件         422  2017-12-04 00:19  code\chapter_07\plot_tree-left-to-right.py
     文件         395  2017-12-04 00:19  code\chapter_07\plot_tree.py
     文件       23279  2017-12-04 00:19  code\chapter_07\pima-indians-diabetes.csv
     目录           0  2017-12-04 00:19  code\chapter_09\
     文件        1518  2017-12-04 00:19  code\chapter_09\feature_selection.py
     文件         443  2017-12-04 00:19  code\chapter_09\automatic_feature_importance.py
     文件       23279  2017-12-04 00:19  code\chapter_09\pima-indians-diabetes.csv
     文件         484  2017-12-04 00:19  code\chapter_09\manual_feature_importance.py
     目录           0  2017-12-04 00:19  code\chapter_14\
     文件        1630  2017-12-04 00:19  code\chapter_14\tune_num_trees_and_depth.py
     文件        1408  2017-12-04 00:19  code\chapter_14\tune_trees.py
     文件        1409  2017-12-04 00:19  code\chapter_14\tune_depth.py
     目录           0  2017-12-04 00:19  code\chapter_15\
     文件        1658  2017-12-04 00:19  code\chapter_15\tune_learning_rate_and_num_trees.py
     文件         343  2017-12-04 00:19  code\chapter_15\plot_performance.py
     文件        1434  2017-12-04 00:19  code\chapter_15\tune_learning_rate.py
     目录           0  2017-12-04 00:19  code\chapter_12\
     文件         630  2017-12-04 00:19  code\chapter_12\check_num_threads.py
     目录           0  2017-12-04 00:19  code\chapter_05\
............此处省略23个文件信息

评论

共有 条评论