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 pandas as pd | |
import numpy as np | |
from sklearn.naive_bayes import MultinomialNB | |
import unicodedata | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.cross_validation import train_test_split | |
path='./BUG-SKLEARN-MNB/' | |
#%% load et normalisation des donnees | |
# def norm(x): |
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 time | |
import sys | |
import numpy as np | |
np.random.seed(0) | |
N = int(1e7) | |
big_array = np.random.random(N) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from IPython import embed_kernel | |
import start_notebook | |
def main(): | |
p = start_notebook.main() | |
localDict = { 'a':1, 'b':2 } | |
embed_kernel() | |
p.kill() |
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 threading | |
import sys | |
import signal | |
# this is the heavy monkey-patching that actually works | |
# i.e. you can start the kernel fine and connect to it e.g. via | |
# ipython console --existing | |
# signal.signal = lambda *args, **kw: None | |
from IPython.zmq.ipkernel import IPKernelApp | |
app = IPKernelApp.instance() |
NewerOlder