https://mlwave.com/kaggle-ensembling-guide/
https://github.com/MLWave/Kaggle-Ensemble-Guide
Average predictions from multiple already trained models (easiest to setup). See error correcting codes (like repetition codes).
| #encoding: utf-8 | |
| from gensim.corpora import WikiCorpus | |
| import codecs | |
| import os | |
| path_for_save_resault = '/home/ubuntu/Documents/hw_background_gene/' | |
| wiki_jpn = WikiCorpus('/home/ubuntu/Documents/hw_background_gene/jawiki-latest-pages-articles.xml.bz2') | |
| with codecs.open(os.path.join(path_for_save_resault,"wiki_jpn.txt") , "w" ,'utf-8') as output: |
https://mlwave.com/kaggle-ensembling-guide/
https://github.com/MLWave/Kaggle-Ensemble-Guide
Average predictions from multiple already trained models (easiest to setup). See error correcting codes (like repetition codes).
| import pandas as pd | |
| import numpy as np | |
| from sklearn.metrics import confusion_matrix,f1_score | |
| from bokeh.io import show, output_file | |
| from bokeh.models import (ColumnDataSource,HoverTool,FixedTicker,PrintfTickFormatter) | |
| from bokeh.plotting import figure | |
| def prabtoclass(series,hold): | |
| #turn probability to binary label by target threshold | |
| return [1 if i>=hold else 0 for i in series] |
| #-*- encoding: utf-8 -*- | |
| from __future__ import division | |
| import math | |
| import struct | |
| import numpy as np | |
| from multiprocessing import Pool, Value, Array | |
| from sklearn.manifold import TSNE | |
| import scipy | |
| import codecs | |
| import argparse |
| import pandas as pd | |
| from datetime import datetime,timedelta | |
| def dealwithshit(d): | |
| return d.apply(lambda x: x.split(' ')[0] if isinstance(x,str) else x).replace({'--':0}).apply(pd.to_numeric,errors='coerce') | |
| class ob: |
| # coding: utf-8 | |
| import pandas as pd | |
| from bokeh.core.properties import field | |
| from bokeh.io import curdoc,output_notebook | |
| from bokeh.layouts import layout,widgetbox,row | |
| from bokeh.models import ( | |
| ColumnDataSource, HoverTool, SingleIntervalTicker, Slider,DateRangeSlider, Button, Label,RelativeDelta, | |
| CategoricalColorMapper,HBox, Select |