This file contains 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
## Data set in https://archive.ics.uci.edu/ml/datasets/bank+marketing does not contain timestamp. | |
## We can "deduce" them from the ordedr of records and use month and day_of_week columns to create a full date | |
## We know the first record was from 05-05-2008 | |
import pandas as pd | |
import numpy as np | |
import datetime as dt | |
import sys | |
# read records from May 2008 to November 2010 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
xgb.plot_tree(booster, num_trees=1, rankdir='LR') | |
fig = matplotlib.pyplot.gcf() | |
fig.set_size_inches(80, 20) | |
fig.savefig('tree.png') |
This file contains 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
import numpy as np | |
import pandas as pd | |
import xgboost as xgb | |
from sklearn.model_selection import train_test_split | |
from sklearn.datasets import make_regression | |
import lime.lime_tabular | |
### make data |
This file contains 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
# coding: utf-8 | |
# In[1]: | |
### using XGBoost model with SHAP | |
import numpy as np | |
import pandas as pd | |
import xgboost as xgb |
This file contains 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
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-cache policy docker-engine | |
sudo apt-get install docker-engine | |
sudo service docker start |
This file contains 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
#!/bin/bash | |
#How to use it? | |
#wget -O- https://gist.github.com/noleto/8103292/raw/e6a77ef6faa0eab3676287b9a265a15b4d9edee3/install-mongo.sh | sh | |
LOG_TIME_FORMAT='date +%d-%m-%Y_%T' | |
echo "------------------------------------------" | |
echo "Install MongoDB on Ubuntu" | |
echo "------------------------------------------" |
This file contains 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
#!/bin/bash | |
MONGO=/path/install/mongo-db/bin | |
HOME=/path/jcdecaux/stockage | |
#Attention: changer le contrat Toulouse par celui de votre ville | |
status=$(curl -w %{http_code} -s 'https://api.jcdecaux.com/vls/v1/stations?contract=Toulouse&apiKey={cleAPI}' -o $HOME/all_stations.json $1) | |
if [ $status -ne 200 ] | |
then |