Prakruti_ANN / main_2.py
Rohankumar31's picture
Upload 4 files
249a203
raw
history blame contribute delete
546 Bytes
import numpy as np
import model_2
model = model_2.model
cols = model_2.target2.columns
def encode(encoders, input_data):
model_input=[]
for i in range(len(input_data)):
row=[]
for j in range(18):
row.extend(encoders[j].transform([input_data.iloc[i][j]]))
model_input.append(row)
model_input=np.array(model_input)
return model_input
def input_output(user_input):
model_input=encode(model_2.encoders, user_input)
output=model.predict(model_input)
final_result = cols[np.argmax(output)]
return final_result