In [1]:
from IPython.display import Image
Image(filename='./images/challenges.jpeg', width=500)
Out[1]:
In [2]:
from IPython.display import YouTubeVideo
YouTubeVideo("TeFF9wXiFfs")
Out[2]:
In [8]:
YouTubeVideo("M5pj2CrO-2w")
Out[8]:
Mitchell ( 1997 ) define Machine Learning as “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P , if its performance at tasks in T , as measured by P , improves with experience E .”
Example: playing checkers.
T = the task of playing checkers.
E = the experience of playing many games of checkers
P = the probability that the program will win the next game.
In [3]:
Image(filename='./images/01_01.png', width=500)
Out[3]:
In [5]:
Image(filename='./images/01_02.png', width=500)
Out[5]:
In [3]:
Image(filename='./images/01_04.png', width=300)
Out[3]:
In [7]:
Image(filename='./images/01_11.png', width=500)
Out[7]:
In [5]:
Image(filename='./images/01_03.png', width=300)
Out[5]:
In [7]:
Image(filename='./images/01_12.png', width=600)
Out[7]:
In [8]:
Image(filename='./images/01_06.png', width=300)
Out[8]:
In [7]:
Image(filename='./images/01_05.png', width=300)
Out[7]:
In [8]:
Image(filename='./images/01_08.png', width=450)
Out[8]:
In [17]:
Image(filename='./images/01_09.png', width=500)
Out[17]:
In [4]:
from __future__ import print_function
import numpy as np
import tflearn
# Download the Titanic dataset
from tflearn.datasets import titanic
titanic.download_dataset('datasets/titanic_dataset.csv')
# Load CSV file, indicate that the first column represents labels
from tflearn.data_utils import load_csv
data, labels = load_csv('datasets/titanic_dataset.csv', target_column=0,
categorical_labels=True, n_classes=2)
# Preprocessing function
def preprocess(data, columns_to_ignore):
# Sort by descending id and delete columns
for id in sorted(columns_to_ignore, reverse=True):
[r.pop(id) for r in data]
for i in range(len(data)):
# Converting 'sex' field to float (id is 1 after removing labels column)
data[i][1] = 1. if data[i][1] == 'female' else 0.
return np.array(data, dtype=np.float32)
# Ignore 'name' and 'ticket' columns (id 1 & 6 of data array)
to_ignore=[1, 6]
# Preprocess data
data = preprocess(data, to_ignore)
print (data)
In [2]:
# Build neural network
net = tflearn.input_data(shape=[None, 6])
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 2, activation='softmax')
net = tflearn.regression(net)
# Define model
model = tflearn.DNN(net)
# Start training (apply gradient descent algorithm)
model.fit(data, labels, n_epoch=10, batch_size=16, show_metric=True)
In [3]:
# Let's create some data for DiCaprio and Winslet
dicaprio = [3, 'Jack Dawson', 'male', 19, 0, 0, 'N/A', 5.0000]
winslet = [1, 'Rose DeWitt Bukater', 'female', 17, 1, 2, 'N/A', 100.0000]
user = [2, 'user', 'female', 20, 0, 2, 'N/A', 50.0000]
# Preprocess data
dicaprio, winslet, user = preprocess([dicaprio, winslet, user], to_ignore)
# Predict surviving chances (class 1 results)
pred = model.predict([dicaprio, winslet, user])
print("DiCaprio Surviving Rate:", pred[0][1])
print("Winslet Surviving Rate:", pred[1][1])
print("user Surviving Rate:", pred[2][1])
In [9]:
from IPython.display import YouTubeVideo
YouTubeVideo("V1eYniJ0Rnk")
Out[9]:
In [10]:
from datetime import timedelta
start=int(timedelta(hours=0, minutes=7, seconds=47).total_seconds())
YouTubeVideo("BfDQNrVphLQ", start=start, autoplay=1, theme="light", color="red")
Out[10]:
In [15]:
Image(filename='./images/01_10.png', width=500)
Out[15]:
In [11]:
YouTubeVideo("PQCrX1sQSzY")
Out[11]:
In [12]:
YouTubeVideo("MqUbdd7ae54")
Out[12]:
Music Generation
Art Generation (Mario levels)
Story Writing
Speech recognition (personal assistants, chat bots)
Face recognition
Lung cancer detection --- prize $1,000,000
Youtube 8m video tagging --- prize $100,000
Detect and classify fish --- prize $150,000
IMAGENET (Large Scale Visual Recognition) --- Fame
Efficient ConvNets for Semantic Segmentation --- prize undeclared
Titanic survival prediction --- Fame and ranking
In [13]:
start=int(timedelta(hours=0, minutes=1, seconds=23).total_seconds())
YouTubeVideo("jBLN1UJbiyw", start=start, autoplay=1, theme="light", color="red")
Out[13]: