[英]Hosting sklearn - SVM Classifier on AWS Sagemaker
我有一個模型在我的 jupyter notebook 實例上運行,它帶有非常基本的 SVM 分類器
# Text lassifier - Algorithm - SVM
# fit the training dataset on the classifier
SVM = svm.SVC(C=1.0, kernel='linear', degree=3, gamma='auto',probability=True)
SVM.fit(Train_X_Tfidf,Train_Y)
# predict the labels on validation dataset
predictions_SVM = SVM.predict(Test_X_Tfidf)
# Use accuracy_score function to get the accuracy
print("SVM Accuracy Score -> ",accuracy_score(predictions_SVM, Test_Y)*100)
用例:在 Sagemaker 上托管模型並創建端點。通過 Lambda 使用端點進行文本分類
我看到 AWS 關於創建端點的帖子很少,例如https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-train-model.html但大部分內容不適用於 scikit-learn :SVM
我應該考慮另一種方法嗎?
如果您的模型足夠小,您可以創建一個 lambda 函數來加載模型並根據用戶傳入的輸入進行預測。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.