Skip to content

Instantly share code, notes, and snippets.

View armgilles's full-sized avatar
🎯
Focusing

GILLES Armand armgilles

🎯
Focusing
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armgilles
armgilles / Features select and ensemble.ipynb
Created July 8, 2016 16:02
Re commit for mlxtend package
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armgilles
armgilles / lr_features_selection.py
Created April 25, 2016 08:15
To select best features for a logistic with gridseachCV
skf = StratifiedKFold(y, n_folds=5, random_state=17, shuffle=True)
C_params = [0.01 , 1, 10, 50, 70, 100]
solvers = ['newton-cg', 'lbfgs', 'liblinear', 'sag']
my_result_list = []
for C_param in C_params:
for solver in solvers:
print "Looking for C : %s and solver : %s" % (C_param, solver)
model = LogisticRegression(class_weight='balanced', random_state=17,
@armgilles
armgilles / my_data_test.csv
Last active April 19, 2016 17:49
data project data for good
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 37 columns, instead of 11 in line 5.
col_0,col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10,col_11,col_12,col_13,col_14,col_15,col_16,col_17,col_18,col_19,col_20,col_21,col_22,col_23,col_24,col_25,col_26,col_27,col_28,col_29,col_30,col_31,col_32,col_33,col_34,col_35,target
1,-0.55709929238,-1.41582824546,0,1,0,0,0,0,-1.09172675508,-0.11581448699,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0
1,0.794916144414,-1.73526870973,1,1,1,0,1,1,1.29499950111,-0.428549821725,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
0,0.254109969696,-0.45750685265,1,1,0,0,0,1,1.29499950111,-0.42411906281,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
1,-0.827502379738,-0.138066388381,1,1,0,0,0,0,-1.68840831912,0.748924173068,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0
1,-0.0162931176624,0.500814540159,1,1,0,1,1,0,0.698317937066,-
@armgilles
armgilles / code_insee_metropole.csv
Last active March 16, 2016 11:35
Listes des code insee des Métropole Française
code_insee siege_agglo
'59350' 'Lille'
'59013' 'Lille'
'59017' 'Lille'
'59044' 'Lille'
'59051' 'Lille'
'59056' 'Lille'
'59090' 'Lille'
'59098' 'Lille'
'59106' 'Lille'
@armgilles
armgilles / Code_insee_aggl_rouen.csv
Created March 16, 2016 10:15
Code INSEE de l'agglomération de Rouen
ville code INSEE
Amfreville-la-Mi-Voie 76005
Anneville-Ambourville 76020
Authieux-sur-le-Port-Saint-Ouen (Les) 76039
Bardouville 76056
Belbeuf 76069
Berville-sur-Seine 76088
Bihorel 76108
Bois-Guillaume 76108
Bonsecours 76103
@armgilles
armgilles / iris_present_insee_abs_ign.csv
Last active March 15, 2016 16:45
Iris qui ne match pas avec le référenciel IGN et les données INSSE
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
CODGEO;LIBGEO;COM;LIBCOM;REG;DEP;UU2010;REG2016;TRIRIS;GRD_QUART;TYP_IRIS;MODIF_IRIS;LAB_IRIS
260570101;Le Bourg;26057;Bourg-de-Péage;82;26;26501;84;ZZZZZZ;2605701;H;00;Z
260570102;La Parisiere;26057;Bourg-de-Péage;82;26;26501;84;ZZZZZZ;2605701;H;00;Z
260570103;Goubetiere Bayannins;26057;Bourg-de-Péage;82;26;26501;84;ZZZZZZ;2605701;H;00;Z
260570104;Maladiere Petite Ardoise;26057;Bourg-de-Péage;82;26;26501;84;ZZZZZZ;2605701;H;00;Z
260580101;Chirouzes;26058;Bourg-lès-Valence;82;26;00651;84;260011;2605801;H;00;1
260580102;Vieux Bourg;26058;Bourg-lès-Valence;82;26;00651;84;260011;2605801;H;00;1
260580201;Valentin;26058;Bourg-lès-Valence;82;26;00651;84;260011;2605802;H;00;1
260580202;Jean Moulin;26058;Bourg-lès-Valence;82;26;00651;84;260011;2605802;H;00;1
260580203;Chony;26058;Bourg-lès-Valence;82;26;00651;84;260021;2605802;H;00;1
@armgilles
armgilles / wine_dataset.csv
Created February 29, 2016 10:56
wine_dataset
1 14.23 1.71 2.43 15.6 127 2.8 3.06 .28 2.29 5.64 1.04 3.92 1065
1 13.2 1.78 2.14 11.2 100 2.65 2.76 .26 1.28 4.38 1.05 3.4 1050
1 13.16 2.36 2.67 18.6 101 2.8 3.24 .3 2.81 5.68 1.03 3.17 1185
1 14.37 1.95 2.5 16.8 113 3.85 3.49 .24 2.18 7.8 .86 3.45 1480
1 13.24 2.59 2.87 21 118 2.8 2.69 .39 1.82 4.32 1.04 2.93 735
1 14.2 1.76 2.45 15.2 112 3.27 3.39 .34 1.97 6.75 1.05 2.85 1450
1 14.39 1.87 2.45 14.6 96 2.5 2.52 .3 1.98 5.25 1.02 3.58 1290
1 14.06 2.15 2.61 17.6 121 2.6 2.51 .31 1.25 5.05 1.06 3.58 1295
1 14.83 1.64 2.17 14 97 2.8 2.98 .29 1.98 5.2 1.08 2.85 1045
1 13.86 1.35 2.27 16 98 2.98 3.15 .22 1.85 7.22 1.01 3.55 1045
@armgilles
armgilles / code_region2016.csv
Last active December 16, 2015 11:59
Code_scrap to region 2016
code_scrap region2016
44 Alsace - Champagne-Ardenne - Lorraine
75 Aquitaine - Limousin - Poitou-Charentes
84 Auvergne - Rhone-Alpes
27 Bourgogne - Franche-Comte
53 Bretagne
24 Centre-Val de Loire
94 Corse
01 Guadeloupe
03 Guyane
@armgilles
armgilles / vote_nb_t2.csv
Created December 14, 2015 16:17
Nombre de vote du 2nd tour par communes pour les régionales (manque quelques DOM TOM)
We can't make this file beautiful and searchable because it's too large.
code_postal,Commune,departement,region,statut,altitude,superficie,population,code_departement,code_region,LAUT,LCMD,LCOM,LCOP,LDIV,LDVD,LDVG,LEXD,LEXG,LFG,LFN,LMAJ,LMMD,LREG,LSOC,LUD,LUG,LVEC,abstentions,blanc,code_insee,exprime,inscrit,nul,url,votant
39270,ALIEZE,JURA,FRANCHE-COMTE,Commune simple,587.0,582.0,200.0,39,43,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,33.0,0.0,0.0,0.0,0.0,23.0,25.0,0.0,43.0,0.0,39007,81.0,126.0,2.0,http://elections.interieur.gouv.fr/regionales-2015/27/2739/2739007.html,83.0
88600,CHAMP-LE-DUC,VOSGES,LORRAINE,Commune simple,454.0,396.0,500.0,88,41,0.0,0.0,0.0,0.0,0.0,0.0,61.0,0.0,0.0,0.0,117.0,0.0,0.0,0.0,0.0,137.0,0.0,0.0,150.0,9.0,88086,315.0,480.0,6.0,http://elections.interieur.gouv.fr/regionales-2015/44/4488/4488086.html,330.0
62490,NOYELLES-SOUS-BELLONNE,PAS-DE-CALAIS,NORD-PAS-DE-CALAIS,Commune simple,49.0,426.0,800.0,62,31,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,174.0,0.0,0.0,0.0,0.0,208.0,0.0,0.0,155.0,24.0,62627,382.0,572.0,11.0,http://elections.interieur.gouv.fr/regionales-20