- numpy - scikit-learn - paths: - ./dtsync/RandomForestClassifi.pk1 import js import numpy as np import warnings warnings.filterwarnings("ignore") import pickle model = pickle.load(open('RandomForestClassifi.pk1' , 'rb')) def predict(inputs): output = model.predict(inputs.reshape(1, -1))[0] return int(output) def get_input(*args, **kwargs): input_list=[ Element('ph').element.value, Element('hardness').element.value, Element('solids').element.value, Element('chloramines').element.value, Element('sulfate').element.value, Element('conductivity').element.value, Element('organic_carbon').element.value, Element('trihalomethanes').element.value, Element('turbidity').element.value ] inputs=np.array(input_list) result = predict(inputs) if result==0: js.throw_red_alert() #alertify.alert('Potability Prediction', 'The water with above parameters is not potable.', function(){ alertify.success('Ok'); }); #document.getElementById('op').innerHTML = "The water with above parameters is not potable." else: js.throw_green_alert() #alertify.alert('Potability Prediction', 'The water with above parameters is potable.', function(){ alertify.success('Ok'); }); #document.getElementById('op').innerHTML = "The water with above parameters is potable."

Water Potability Identification

✨ Water Quality Information ✅