<jupyter_start><jupyter_text>Lung nodule CNN analysis<jupyter_code>import numpy as np
import pandas as pd

import matplotlib.pyplot as plt
import seaborn as sns 

import tflearn
import h5py

from PIL import Image

from scipy.misc import imread

%matplotlib inline
from IPython.display import clear_output
pd.options.mode.chained_assignment = None
import sys
sys.path.append('../src/models/')
from cnn_model import CNNModel
h5f2 = h5py.File('../src/data/test.h5', 'r')
X_test_images = h5f2['X']
Y_test_labels = h5f2['Y']
h5f2.close()

h5f = h5py.File('../src/data/train.h5', 'r')
X_train_images = h5f['X']
Y_train_labels = h5f['Y']
h5f.close()
## Model definition
convnet  = CNNModel()
network = convnet.define_network(X_train_images)
model = tflearn.DNN(network)
model.load("nodule-classifier.tfl")
predictions = model.predict(X_test_images[:,:,:,:])
score = model.evaluate(X_test_images, Y_test_labels)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13183279742765272, 'fraction_numerical': 0.01822079314040729, 'mean_word_length': 6.022556390977444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '239599', 'license': 'MIT', 'n_tokens_mistral': 370, 'n_tokens_neox': 366, 'n_words': 76, 'path': 'notebooks/CNNresultsAnalysis.ipynb', 'repo_name': 'mtodi7/LungsCancerDetections', 'size': '933'}