Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires Numpy | |
def add_nan_to_data(train_inputs, miss_prob=0.2): | |
""" | |
Randomly flips a numpy ndarray entry to NaN with a supplied | |
probability. | |
WARNING: Do not try to add missing values to labels. This is | |
not unsupervised learning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def get_city_map(): | |
""" | |
Returns a map of the city with buildings marked with '0' in a numpy array. | |
Accepts no arguments. | |
""" | |
city_map = np.array([[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], |