File size: 2,108 Bytes
3f947d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# cnn part
import numpy as np
import pandas as pd
from tensorflow.keras import models
from tensorflow.keras.preprocessing import image
from PIL import Image, UnidentifiedImageError

# load the model
loaded_model = models.load_model('728cnn.h5')

print(loaded_model.summary())

'''import numpy as np
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# plot the graph of disease distribution in different positions
from matplotlib import pyplot as plt

dataset = pd.read_csv("/Users/yuxizheng/xizheng/proj_past_7007/Week_5/Skin_Cancer_MNIST_HAM10000/hmnist_28_28_RGB.csv")

image_data = dataset.drop(['label'], axis = 1)
image_data = np.array(image_data)
images = image_data.reshape(-1, 28, 28, 3)

plt.figure(figsize = (10,20))
for i in range(5) :
    plt.subplot(1,5,i+1)
    plt.imshow(images[i])
plt.show()'''

'''
import numpy as np
import pandas as pd
from tensorflow.keras import models
import joblib

# load the model
# training = models.load_model("828cnn.h5")
dataset = pd.read_csv("/Users/yuxizheng/xizheng/proj_past_7007/Week_5/Skin_Cancer_MNIST_HAM10000/hmnist_28_28_RGB.csv")
metadata = pd.read_csv("/Users/yuxizheng/xizheng/proj_past_7007/Week_5/Skin_Cancer_MNIST_HAM10000/HAM10000_metadata.csv")
print(metadata['dx'].value_counts())
from matplotlib import pyplot as plt
import seaborn as sns
sns.countplot(x = 'dx', data = metadata)
plt.title('Disease class distribution')
plt.show()
'''
'''
history = joblib.load('/Users/yuxizheng/xizheng/proj_past_7007/Week_9/history_cnn')

print(history['accuracy'])
print(history['val_accuracy'])
print(history['loss'])
print(history['val_loss'])
'''
'''
from matplotlib import pyplot as plt
# plot the accuracy of training and validation
plt.plot(history['accuracy'])
plt.plot(history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'validation'])
plt.show()

# plot the loss of training and validation
plt.plot(history['loss'])
plt.plot(history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'validation'])
plt.show()
'''