<jupyter_start><jupyter_text>폐암 수술 환자의 생존율 예측하기 실습<jupyter_code>from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import tensorflow as tf
# 실행할 때마다 같은 결과를 출력하기 위해 설정하는 부분
np.random.seed(3)
tf.random.set_seed(3)
# 준비된 수술 환자 데이터를 불러오기
Data_set = np.loadtxt('./dataset/ThoraricSurgery.csv', delimiter=',')
# 환자의 기록과 수술 결과를 X와 Y로 구분하여 저장
X = Data_set[:, 0:17]
Y = Data_set[:, 17]
# 딥러닝 구조를 결정(모델을 설정하고 실행)
model = Sequential()
model.add(Dense(30, input_dim=17, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# 딥러닝 실행
model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
model.fit(X, Y, epochs=100, batch_size=10)<jupyter_output>Epoch 1/100
47/47 [==============================] - 0s 511us/step - loss: 0.1485 - accuracy: 0.8426
Epoch 2/100
47/47 [==============================] - 0s 447us/step - loss: 0.1402 - accuracy: 0.8511
Epoch 3/100
47/47 [==============================] - 0s 447us/step - loss: 0.1433 - accuracy: 0.8489
Epoch 4/100
47/47 [==============================] - 0s 447us/step - loss: 0.1395 - accuracy: 0.8511
Epoch 5/100
47/47 [==============================] - 0s 426us/step - loss: 0.1386 - accuracy: 0.8468
Epoch 6/100
47/47 [==============================] - 0s 447us/step - loss: 0.1406 - accuracy: 0.8511
Epoch 7/100
47/47 [==============================] - 0s 426us/step - loss: 0.1336 - accuracy: 0.8489
Epoch 8/100
47/47 [==============================] - 0s 426us/step - loss: 0.1384 - accuracy: 0.8511
Epoch 9/100
47/47 [==============================] - 0s 426us/step - loss: 0.1379 - accuracy: 0.8511
Epoch 10/100
47/47 [==============================] - 0s 447us/step - loss: 0.1413 - accura[...]
{'fraction_non_alphanumeric': 0.3023121387283237, 'fraction_numerical': 0.13468208092485548, 'mean_word_length': 4.583870967741936, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '119514', 'license': 'MIT', 'n_tokens_mistral': 899, 'n_tokens_neox': 782, 'n_words': 162, 'path': 'predicting_survival_rate_lung_cancer_surgery.ipynb', 'repo_name': 'Karmantez/DeepLearning_Practice', 'size': '1730'}