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 tensorflow | |
import keras | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout | |
from keras.utils import to_categorical | |
from keras.callbacks import EarlyStopping | |
from keras.optimizers import SGD, Adam | |
from keras.callbacks import History | |
from sklearn.model_selection import train_test_split |
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 itertools | |
from sklearn.model_selection import train_test_split | |
from sklearn.neighbors import KNeighborsClassifier | |
import matplotlib.pyplot as plt | |
def Multi_KNN_Class(X, y, test_s=0.1, neighbors=[1,2,3], p_val=[1,2], leaf=[30], iterations=20, fig_s=(15,9), path=os.getcwd(), plot=False, verbose=True): | |
"""test out all combinations of hyperparameters to find the best model configuration. Returns statistics for mean and standard | |
deviation of accuracy over the amount of iterations for each hyperparameter settings.""" | |
mu_sigma_list = [] |
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 bs4 import BeautifulSoup | |
import sys | |
import requests | |
import re | |
import string | |
import time | |
import random | |
import urllib | |
import traceback |
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
""" | |
This script was created for the purpose of machine learning on tic-tac-toe. | |
You may extend the board to any square size. | |
the script will write to two csv files: one for predictors and the other for target | |
Special predictor Values: | |
dd - filled space from either player winning to pad the empty spaces | |
Target Variable Values: |
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 # linear algebra | |
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | |
import string | |
import re | |
from nltk.tokenize import word_tokenize | |
import keras | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout, LSTM | |
from keras.utils import to_categorical | |
from keras.callbacks import EarlyStopping |
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 plotly as py | |
import plotly.graph_objs as go | |
import numpy as np | |
#py.tools.set_credentials_file(username='user_name', api_key='api_key') | |
py.offline.init_notebook_mode(connected=True) | |
def make_trace(x, y, mode='markers', pltname=None, shape='spline'): | |
trace = go.Scatter(x = x, y = y, mode = mode, name = pltname, line = dict(shape=shape)) | |
return trace |
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 # linear algebra | |
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | |
import os | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
from matplotlib.pyplot import imshow | |
from skimage import transform | |
from sklearn.model_selection import train_test_split | |
import traceback | |
from sklearn.utils import shuffle |
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
"""The following script contains two functions. One for creating a wordcloud from a string. The second is for cleaning text found | |
in a dataframe column.""" | |
import numpy as np # linear algebra | |
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | |
import os | |
from wordcloud import WordCloud, STOPWORDS | |
import string | |
import matplotlib.pyplot as plt | |
from nltk.corpus import stopwords |
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 the module | |
import subprocess | |
class TextMessage(): | |
def __init__(self, url, from_, message, creds, number): | |
self.tool = 'curl' | |
self.url = url | |
self.from_ = 'From=%s' % from_ | |
self.message = 'Body=%s' % message |
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 | |
from datetime import datetime, timedelta | |
import time | |
import subprocess | |
import re | |
if os.geteuid() != 0: | |
exit("You need to have root privileges to run this script.") | |
class DeviceTracker(): |
OlderNewer