반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

keras.iris(분류) 본문

[AI]/python.keras

keras.iris(분류)

givemebro 2020. 5. 13. 11:27
반응형
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense
# data 준비

X = iris.data[:100]
y = iris.target[:100]

 

 

model=Sequential()
model.add(Dense(1,input_shape=(4,),activation='sigmoid'))
from keras.optimizers import SGD
model.compile(loss='binary_crossentropy',optimizer=SGD(lr=0.1),metrics=['acc'])
# metrics=['acc'] : 화면 출력 할 때 정확도도 출력해라!(history에서 확인 가능)
model.fit(X,y,epochs=1000)

 

 

plt.plot(model.history.history['loss'])

반응형

'[AI] > python.keras' 카테고리의 다른 글

keras.score  (0) 2020.05.13
keras.mnist(중간층)  (0) 2020.05.13
keras.mnist(중간층X)  (0) 2020.05.13
keras.mnist  (0) 2020.05.13
keras.basic(분류)  (0) 2020.05.13
keras.iris(예측 )  (0) 2020.05.13
keras.basic(예측)  (0) 2020.05.13
keras.install  (0) 2020.05.13
Comments