Skip to content

Instantly share code, notes, and snippets.

// Procedure: Each connection should link lower to higher
let layout = [
[0, 1, 2],
[7, 8, 3],
[6, 5, 4],
];
// Encoding
let digits = [
"0107122334455667", // 0
import numpy as np
import cv2
import time
import datetime
# import the cascade for face detection
face_cascade = cv2.CascadeClassifier("cascades/haarcascade_frontalface_default.xml")
def TakeSnapshotAndSave():
# access the webcam (every webcam has a number, the default is 0)
@jwalsh
jwalsh / convolutional.py
Created February 12, 2019 16:49
Step 0, training batch accuracy 12 % Step 100, training batch accuracy 83 % Step 200, training batch accuracy 98 % Step 300, training batch accuracy 92 % Step 400, training batch accuracy 94 % Step 500, training batch accuracy 95 % Step 600, training batch accuracy 100 % Step 700, training batch accuracy 97 % Step 800, training batch accuracy 98…
import tensorflow as tf
image_size = 28
labels_size = 10
hidden_size = 1024
# Define placeholders
training_data = tf.placeholder(tf.float32, [None, image_size*image_size])
training_images = tf.reshape(training_data, [-1, image_size, image_size, 1])
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
image_size = 28
labels_size = 10
// Create mock features for evaluating AWS ML performance
const fs = require('fs');
let header = [];
['training', 'batch-prediction']
.map(s => {
'abcdefghijklmnopqrstuvwxyz'
{
"version" : "1.0",
"rowId" : null,
"rowWeight" : null,
"targetAttributeName" : "t",
"dataFormat" : "CSV",
"dataFileContainsHeader" : true,
"attributes" : [ {
"attributeName" : "a0",
"attributeType" : "NUMERIC"
@jwalsh
jwalsh / titanic.csv
Last active February 22, 2025 08:57
PassengerId Survived Pclass Lname Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
1 0 3 Braund Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
2 1 1 Cumings Mrs. John Bradley (Florence Briggs Thayer) female 38 1 0 PC 17599 71.2833 C85 C
3 1 3 Heikkinen Miss. Laina female 26 0 0 STON/O2. 3101282 7.925 S
4 1 1 Futrelle Mrs. Jacques Heath (Lily May Peel) female 35 1 0 113803 53.1 C123 S
5 0 3 Allen Mr. William Henry male 35 0 0 373450 8.05 S
6 0 3 Moran Mr. James male 0 0 330877 8.4583 Q
7 0 1 McCarthy Mr. Timothy J male 54 0 0 17463 51.8625 E46 S
8 0 3 Palsson Master. Gosta Leonard male 2 3 1 349909 21.075 S
9 1 3 Johnson Mrs. Oscar W (Elisabeth Vilhelmina Berg) female 27 0 2 347742 11.1333 S
fixed acidity volatile acidity citric acid residual sugar chlorides free sulfur dioxide total sulfur dioxide density pH sulphates alcohol quality
7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5
7.8 0.88 0 2.6 0.098 25 67 0.9968 3.2 0.68 9.8 5
7.8 0.76 0.04 2.3 0.092 15 54 0.997 3.26 0.65 9.8 5
11.2 0.28 0.56 1.9 0.075 17 60 0.998 3.16 0.58 9.8 6
7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5
7.4 0.66 0 1.8 0.075 13 40 0.9978 3.51 0.56 9.4 5
7.9 0.6 0.06 1.6 0.069 15 59 0.9964 3.3 0.46 9.4 5
7.3 0.65 0 1.2 0.065 15 21 0.9946 3.39 0.47 10 7
7.8 0.58 0.02 2 0.073 9 18 0.9968 3.36 0.57 9.5 7
We can't make this file beautiful and searchable because it's too large.
age,job,marital,education,default,housing,loan,contact,month,day_of_week,duration,campaign,pdays,previous,poutcome,emp_var_rate,cons_price_idx,cons_conf_idx,euribor3m,nr_employed,y
44,blue-collar,married,basic.4y,unknown,yes,no,cellular,aug,thu,210,1,999,0,nonexistent,1.4,93.444,-36.1,4.963,5228.1,0
53,technician,married,unknown,no,no,no,cellular,nov,fri,138,1,999,0,nonexistent,-0.1,93.2,-42,4.021,5195.8,0
28,management,single,university.degree,no,yes,no,cellular,jun,thu,339,3,6,2,success,-1.7,94.055,-39.8,0.729,4991.6,1
39,services,married,high.school,no,no,no,cellular,apr,fri,185,2,999,0,nonexistent,-1.8,93.075,-47.1,1.405,5099.1,0
55,retired,married,basic.4y,no,yes,no,cellular,aug,fri,137,1,3,1,success,-2.9,92.201,-31.4,0.869,5076.2,1
30,management,divorced,basic.4y,no,yes,no,cellular,jul,tue,68,8,999,0,nonexistent,1.4,93.918,-42.7,4.961,5228.1,0
37,blue-collar,married,basic.4y,no,yes,no,cellular,may,thu,204,1,999,0,nonexistent,-1.8,92.893,-46.2,1.327,5099.1,0
39,blue-collar,divorced,basic.9y,no,yes,no,cel
Sex Length Diam Height Whole Shucked Viscera Shell Rings
M 0.455 0.365 0.095 0.514 0.2245 0.101 0.15 15
M 0.35 0.265 0.09 0.2255 0.0995 0.0485 0.07 7
F 0.53 0.42 0.135 0.677 0.2565 0.1415 0.21 9
M 0.44 0.365 0.125 0.516 0.2155 0.114 0.155 10
I 0.33 0.255 0.08 0.205 0.0895 0.0395 0.055 7
I 0.425 0.3 0.095 0.3515 0.141 0.0775 0.12 8
F 0.53 0.415 0.15 0.7775 0.237 0.1415 0.33 20
F 0.545 0.425 0.125 0.768 0.294 0.1495 0.26 16
M 0.475 0.37 0.125 0.5095 0.2165 0.1125 0.165 9