-
[ TIL 221028 ]Today I Learned 2022. 11. 20. 17:37
๐ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ก
์์ญ scope
ํ๋ก๊ทธ๋จ์์ ์ฌ์ฉ๋๋ ์๋ณ์๊ฐ ์๋ฏธ๋ฅผ ๊ฐ์ง ์ ์๋ ๋ฒ์๋ธ๋ก block
๋ณตํฉ๋ฌธ ์์ ๋ณ์, ๋ ์ด๋ธ๊ณผ ๊ฐ์ ์ง์ญ ์๋ณ์๋ฅผ ์ ์ธํ๋ ๋ฌถ์ธ ๋ถ๋ถ. ๋ธ๋ก์ด ์คํ๋๋ ๋์ ๋ณ์๋ค์ด ์๋ฏธ๋ฅผ ๊ฐ์ง.๐ ๋ฅ๋ฌ๋
csv : comma seperated value
2์ฐจ์ ํ๋ ฌ Data
[ ] [ ] Java, C
[ ํ, ์ด ] Python๋จธ์ ๋ฌ๋์ ๋ฐ์ดํฐ ์์์ ๊ท์น์ ๋ฐ๊ฒฌํ๊ณ ๊ทธ ๊ท์น์ ์๋ก์ด ๋ฐ์ดํฐ์ ์ ์ฉํด์ ์๋ก์ด ๊ฒฐ๊ณผ ๋์ถ
- ๋ฅ๋ฌ๋ ๋ชจ๋ธ ๋ง๋๋ ค๋ฉด Sequential ๋ก ์๋ฆฌ์ฐจ์ง :
# ํ๊ฒฝ ์ค๋น
from tensorflow.python.keras.models import Sequentialfrom tensorflow.python.keras.layers import Denseimport numpy as np# ๋ฐ์ดํฐ ์ค๋น!git clone https://github.com/taehojo/data.gitData_set = np.loadtxt("./data/ThoraricSurgery3.csv", delimiter=",")X = Data_set[:,0:16]y = Data_set[:,16]# ๊ตฌ์กฐ ๊ฒฐ์ model = Sequential()model.add(Dense(30, input_dim=16, activation='relu'))model.add(Dense(1, activation='sigmoid'))# ๋ชจ๋ธ ์คํmodel.compile(loss='binary_crossentropy',optimizer='adam', metrics=['accuracy'])history=model.fit(X,y,epochs=5, batch_size=16)'Today I Learned' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ 221228 WED ] TIL (0) 2022.12.28 [ TIL 221120 ] (0) 2022.11.21 [ TIL - 220928 ] (0) 2022.09.29 [ TIL 220927 ] (0) 2022.09.28 [ TIL 220922 ] THU (0) 2022.09.24