April 2017
Intermediate to advanced
320 pages
7h 46m
English
The full code for the implemented classifier is as follows:
from tflearn.datasets import titanic titanic.download_dataset('titanic_dataset.csv') from tflearn.data_utils import load_csv data, labels = load_csv('titanic_dataset.csv', target_column=0, categorical_labels=True, n_classes=2) def preprocess(data, columns_to_ignore): for id in sorted(columns_to_ignore, reverse=True): [r.pop(id) for r in data] for i in range(len(data)): data[i][1] = 1. if data[i][1] == 'female' else 0. return np.array(data, dtype=np.float32) to_ignore=[1, 6] data = preprocess(data, to_ignore) net = tflearn.input_data(shape=[None, 6]) net = tflearn.fully_connected(net, 32) net = tflearn.fully_connected(net, 32) net = tflearn.fully_connected(net, ...Read now
Unlock full access