Last Update: November 4, 2016
Offline Version
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 random | |
import numpy as np | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from sklearn.datasets.samples_generator import make_blobs | |
from sklearn.preprocessing import MinMaxScaler | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score | |
from sklearn.metrics import mean_squared_error |
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 | |
wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh -O ~/anaconda.sh && \ | |
/bin/bash ~/anaconda.sh -b -p /opt/conda && \ | |
rm ~/anaconda.sh && \ | |
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ | |
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ | |
echo "conda activate base" >> ~/.bashrc |
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 os | |
import sys | |
import wget | |
import pandas as pd | |
from multiprocessing import Pool | |
FILE_PATH = sys.argv[1] | |
def get_file_paths(FILE_PATH): | |
df = pd.read_csv(FILE_PATH, header=None) |
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 os | |
def count(path): | |
ld = os.listdir(path) | |
#print (ld) | |
result = 0 | |
for name in ld: | |
if os.path.isdir(path+'/'+name): | |
#print (name) | |
ld2 = os.listdir("{}/{}/".format(path,name)) |
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 __future__ import print_function | |
import os | |
import sys | |
import Queue | |
import threading | |
import urllib | |
import time | |
PARALLEL = True | |
if not os.path.exists("parallels"): |
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 __future__ import division, print_function | |
import numpy as np | |
import itertools | |
class FPTreeNode(): | |
def __init__(self, item=None, support=1): | |
self.item = item | |
self.support = support | |
self.children = {} |