Skip to content

Instantly share code, notes, and snippets.

@PhilipPurwoko
Created September 19, 2020 13:23
Show Gist options
  • Save PhilipPurwoko/01efa5c74a6bff2ecef12214dcd25853 to your computer and use it in GitHub Desktop.
Save PhilipPurwoko/01efa5c74a6bff2ecef12214dcd25853 to your computer and use it in GitHub Desktop.
import pickle
with open('AI_DrugClassifier.pkl','rb') as file:
model = pickle.load(file)
def self_prediction():
age = input('Age : ')
sex = input('Sex : ')
bp = input('BP : ')
chol = input('Cholesterol : ')
NatoK = input('Na_to_K : ')
# data harus berbentuk (1,5) yaitu [[age,sex,bp,chol,NatoK]]
print('\nPrediction')
print('Patient consumed : ',encoder.inverse_transform(model.predict([[age,sex,bp,chol,NatoK]]))[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment