March 2020
Intermediate to advanced
366 pages
9h 8m
English
Analogous to Chapter 7, Learning to Recognize Traffic Signs, we write a new dataset parser in data/emotions.py that will parse our self-assembled training set.
We define a load_data function that will load the training data and return a tuple of collected data and their corresponding labels, as follows:
def load_collected_data(path): data, targets = [], [] with open(path, 'r', newline='') as infile: reader = csv.reader(infile) for label, sample in reader: targets.append(label) data.append(json.loads(sample)) return data, targets
This code, similar to all the processing codes, is self-contained and resides in the data/process.py file, similar to Chapter 7, Learning to Recognize Traffic Signs.
Our featurization function ...
Read now
Unlock full access