def predict_banknote(data: BankNote): data = data.dict() variance = data['variance'] skewness = data['skewness'] curtosis = data['curtosis'] entropy = data['entropy'] prediction = classifier.predict([[variance, skewness, curtosis, entropy]]) if (prediction[0] > 0.5): prediction = "Fake note" else: prediction = "Its a Bank note" return {'prediction': prediction}
async def predict(data: BankNote): data = data.dict() variance = data['variance'] skewness = data['skewness'] curtosis = data['curtosis'] entropy = data['entropy'] predictedValue = model.predict_proba( [[variance, skewness, curtosis, entropy]])[:, 1][0] if predictedValue < 0.5: prediction = "Fake Note" else: prediction = "Authentic Bank Note" return {'prediction': prediction}
def predict_banknote(data:BankNote): data = data.dict() print(data) variance = data['variance'] skewness = data['skewness'] curtosis = data['curtosis'] entropy = data['entropy'] print(classifier.predict([[variance,skewness,curtosis,entropy]])) prediction = classifier.predict([[variance,skewness,curtosis,entropy]]) if(prediction[0]>0.5): prediction = 'Fake Note' else: prediction = 'Genuine Bank Note' return {'prediction':prediction}
def pred_bank( data: BankNote ): #capture the i/p features needed from the class object and assign to an object data data = data.dict() print(data) variance = data["variance"] print(variance) skewness = data["skewness"] curtosis = data['curtosis'] entropy = data["entropy"] print(classifier.predict([[variance, skewness, curtosis, entropy]])) prediction = classifier.predict([[variance, skewness, curtosis, entropy]]) if prediction[0] > 0.5: prediction = "Fake_Note" else: prediction = "Genuine Note" return {"prediction": prediction}