Skip to content

Instantly share code, notes, and snippets.

@ngmars

ngmars/createFunction.py

Last active Nov 22, 2020
Embed
What would you like to do?
import joblib
clf.fit(y_train, X_train)
weight = 'new_model.sav'
joblib.dump(clf, weight)
#define a function and pass your parameters
def predict(A,B,C):
arr=[A,B,C]
y_test=[arr]
y_test=np.asarray(y_test)
X_pred_prob = loaded_model.predict_proba(y_test)
prediction= loaded_binarizer.inverse_transform(X_pred_new)
print(prediction)
#make sure you return the vaule, this would help you create the API
return([A,B,C],prediction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.