• Aucun résultat trouvé

Gradient boosting

N/A
N/A
Protected

Academic year: 2022

Partager "Gradient boosting"

Copied!
2
0
0

Texte intégral

(1)

Gradient boosting

Data science Master 2 ISiDIS

2016 / 2017

Prise en main et exemples d’utilisation

1. Lancer depuis un terminal jupyter (anciennement ipython) et notebook : jupyter notebook

ou anciennement :

ipython notebook --pylab=inline

2. Cr´eer un nouveau notebook dans lequel vous pouvez ex´ecuter des commandes python. Dans le pylab, les biblioth`eques numpy, scipy, matplotlib, pandas, sklearn sont automatiquement import´ee.

3. Suivre l’exemple de classification avec le gradient boosting de la page 20 des slides de Peter Pret- tenhofer et Gilles Louppe disponibles `a l’urlhttp://orbi.ulg.ac.be/bitstream/2268/163521/

1/slides.pdf.

4. Suivre l’exemple donn´e par la librairie scikit-learn sur la r´egularisation du gradient boosting :

http://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regularization.

html

Exemple de r´ egression et param` etres

1. Quels sont les principaux param`etres r´eglables du gradient boosting de la biblioth`eque scikit-learn ? 2. Importer le jeu de donn´ees ’boston’ et cr´eer des jeux de test d’apprentissage et de test `a l’aide des

lignes suivantes. Que d´etermine le nombre0.9? from sklearn import datasets

from sklearn.utils import shuffle

X, y = shuffle(boston.data, boston.target, random_state=13) X = X.astype(np.float32)

offset = int(X.shape[0] * 0.9)

X_train, y_train = X[:offset], y[:offset]

X_test, y_test = X[offset:], y[offset:]

3. Calculer la r´egression gradient boosting avec les param`etres suivants :

params = {’n_estimators’: 500, ’max_depth’: 4, ’min_samples_split’: 1,

’learning_rate’: 0.01, ’loss’: ’ls’}

1

(2)

4. Tracer les courbes d’erreur en apprentissage et en test au cours des it´erations de l’algorithme `a l’aide de la fonction suivante :

def diagnose(X, gb, params):

test_score = np.zeros((params[’n_estimators’],), dtype = np.float64) for i, y_pred in enumerate(gb.staged_decision_function(X_test)):

test_score[i] = gb.loss_(y_test, y_pred) pl.figure(figsize=(12, 9))

pl.title(’Deviance’)

pl.plot(np.arange(params[’n_estimators’]) + 1, gb.train_score_,

’b-’, label = ’Training Set Deviance’)

pl.plot(np.arange(params[’n_estimators’]) + 1, test_score,

’r-’, label = ’Test Set Deviance’) pl.legend(loc=’upper right’)

pl.xlabel(’Boosting iterations’) pl.ylabel(’Deviance’)

pl.show()

5. Modifier les param`etres du gradient boosting et observer les effets sur les courbes d’apprentissage et de test.

6. D´eterminer les (hyper)param`etres optimaux du gradient boosting `a l’aide de la technique expos´e page 27 des slides de Peter Prettenhofer et Gilles Louppe.

2

Références

Documents relatifs

The purpose of this paper is to present our work related to the adaptation to bridge of a recent methodology used for boosting game Artificial Intelligence (AI) by seeking a

In the context of our kernelized boosting algorithm, the base learner should be able to optimize square error in a kernelized output space and provide predictions in the form (4).. In

We introduce in Section 2 a general framework for studying the algorithms from the point of view of functional optimization in an L 2 space, and prove in Section 3 their convergence

In this paper, our contribution is three-fold: (i) focusing on AP , we show how to optimize a loss function based on a surrogate of this criterion; (ii) unlike the state of the

weak neural network with one hidden layer composed of 2 units (2-NN) and a stronger learner consisting of a neural network with 500 units in its unique hid- den layer (500-NN).

In the present paper, we extend the vanishing-learning-rate asymptotic beyond lin- ear boosting and obtain the existence of a limit for gradient boosting with a general convex

The work proposed in this paper provides an approach for road recognition for inner-city scenarios based on the novel method that join a multi normalized-histogram with a Joint

In Figure 7.9, one can see that the spread between the average returns of decile 1 and decile 10 is higher for the ML model (9.8%) compared with the linear combination of the top