from keras.models import Sequential
from keras.layers import Dense
import numpy as np
import pandas as pd
def ReadData(sf):
print("Baca file :",sf)
df = np.array(pd.read_csv(sf,header=None))
df1 = pd.DataFrame(df)
return df1.values
def ReadData2(sf,lw):
print("Baca file :",sf)
df = np.array(pd.read_csv(sf,header=None))
y=df[lw:,3:4]
x=[];
for i in range(len(df)-lw):
dm=np.concatenate((df[i:i+lw,0],df[i:i+lw,1],df[i:i+lw,2]))
x.append(dm)
x=np.array(x)
return x,y
sf='Data.csv'
X,Y=ReadData2(sf,20)
model = Sequential()
model.add(Dense(1000, input_dim=60, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
history = model.fit(X, Y, epochs=500, batch_size=1)
https://www.pyimagesearch.com/2019/02/04/keras-multiple-inputs-and-mixed-data/
https://drive.google.com/open?id=13R-SxdZVdNG_2CAACgGnTJxX1Tz8f8zF
No comments:
Post a Comment