- Assumes NVIDIA GPU
- Prefers Ubuntu native packages over Docker for simplicity
sudo apt-get update && sudo apt-get -y upgrade
var GH = ['#EEEEEE', '#D6E685', '#8CC665', '#44A340', '#1E6823']; | |
var CO = ['#EF4B4D', '#F89B47', '#FAEA20', '#7DC242', '#5D94CE', '#855CA7']; | |
var graph = document.getElementsByClassName('js-calendar-graph-svg')[0]; | |
var days = [].slice.call(graph.getElementsByTagName('rect'), 0); | |
days.forEach(function(rect) { | |
switch(rect.getAttribute('fill').toUpperCase()) { | |
case GH[0]: rect.setAttribute('fill', CO[2]); break; // yellow | |
case GH[1]: rect.setAttribute('fill', CO[Math.floor(Math.random() * 2)]); break; // red || orange |
from sklearn.datasets import load_iris | |
from sklearn.ensemble import RandomForestClassifier | |
import pandas as pd | |
import numpy as np | |
iris = load_iris() | |
df = pd.DataFrame(iris.data, columns=iris.feature_names) | |
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75 | |
df['species'] = pd.Factor(iris.target, iris.target_names) | |
df.head() |
from mysql import connector | |
from sklearn import linear_model | |
from yhat import Yhat, YhatModel, preprocess | |
class MySQLIrisClassifier(YhatModel): | |
REQUIREMENTS = ['scikit-learn'] | |
def select_data(self, cursor): | |
# Returns the full dataset of features and outputs |
netsh wlan stop hostednetwork | |
pause |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# From "A simple unix/linux daemon in Python" by Sander Marechal | |
# See http://stackoverflow.com/a/473702/1422096 | |
# | |
# Modified to add quit() that allows to run some code before closing the daemon | |
# See http://stackoverflow.com/a/40423758/1422096 | |
# | |
# Joseph Ernest, 2016/11/12 | |
import sys, os, time, atexit | |
from signal import signal, SIGTERM |
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
states = ('Rainy', 'Sunny') | |
observations = ('walk', 'shop', 'clean') | |
start_probability = {'Rainy': 0.6, 'Sunny': 0.4} | |
transition_probability = { | |
'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3}, | |
'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6}, | |
} |
import math | |
math.exp(model.score(np.array([[0]]))) | |
# 0.30000000000000004 | |
math.exp(model.score(np.array([[1]]))) | |
# 0.36000000000000004 | |
math.exp(model.score(np.array([[2]]))) | |
# 0.3400000000000001 | |
math.exp(model.score(np.array([[2,2,2]]))) | |
# 0.04590400000000001 |