Skip to content

Instantly share code, notes, and snippets.

@ngmars
Last active November 22, 2020 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngmars/36c2d9a5c346c5f4f8caac6f45d9f747 to your computer and use it in GitHub Desktop.
Save ngmars/36c2d9a5c346c5f4f8caac6f45d9f747 to your computer and use it in GitHub Desktop.
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