This file contains 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
if scale_cols: | |
# Scale year and week no but within (0,1) | |
new_data[scale_cols] = MinMaxScaler(feature_range=(0, 1)).fit(train_scale[scale_cols]).transform( | |
new_data[scale_cols]) |
This file contains 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
unnormalized_train_data = extract_data(path_to_train_file) | |
normalized_train_data, train_scale = preproc_data(unnormalized_train_data, norm_cols, scale_cols) | |
// Create and train model | |
unnormalized_test_data = extract_data(path_to_test_file) | |
normalized_test_data, _ = preproc_data(unnormalized_test_data, norm_cols, scale_cols, train_scale) |
This file contains 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
def plot_confusion_matrix(cm, class_names=class_names): | |
""" | |
Returns a matplotlib figure containing the plotted confusion matrix. | |
Args: | |
cm (array, shape = [n, n]): a confusion matrix of integer classes | |
class_names (array, shape = [n]): String names of the integer classes | |
""" | |
figure = plt.figure(figsize=(8, 8)) | |
plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues) |
This file contains 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
# Load the TensorBoard notebook extension | |
%load_ext tensorboard | |
# Clear out any prior log data. (optional) | |
!rm -rf logs | |
import datetime | |
import io | |
import itertools | |
import numpy as np |
This file contains 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
export const DicomDictionary = { | |
'00000000': 'Command Group Length', | |
'00000001': 'Command Length to End', | |
'00000002': 'Affected SOP Class UID', | |
'00000003': 'Requested SOP Class UID', | |
'00000010': 'Command Recognition Code', | |
'00000100': 'Command Field', | |
'00000110': 'Message ID', | |
'00000120': 'Message ID Being Responded To', | |
'00000200': 'Initiator', |
OlderNewer