Javascript 在chrome扩展中使用现有SVM分类器(用python创建)的可能性?
我使用python创建了一个SVM分类器,对其进行训练并将其导出:Javascript 在chrome扩展中使用现有SVM分类器(用python创建)的可能性?,javascript,python,google-chrome-extension,classification,svm,Javascript,Python,Google Chrome Extension,Classification,Svm,我使用python创建了一个SVM分类器,对其进行训练并将其导出: X_train, Y_train, X_test, Y_test = train_test_split(...) clf = svm.SVC(gamma='scale',kernel='rbf',C=1) clf.fit(X_train, Y_train) joblib.dump(clf, 'SVM_model.pk1', compress=9) 如何利用JavaScript(google chrome extens
X_train, Y_train, X_test, Y_test = train_test_split(...)
clf = svm.SVC(gamma='scale',kernel='rbf',C=1)
clf.fit(X_train, Y_train)
joblib.dump(clf, 'SVM_model.pk1', compress=9)
如何利用JavaScript(google chrome extension)中的SVM_模型分类器进行真正的预测?我可以加载它并将提取的数据提供给它吗?
我确实意识到可以使用XMLHttpRequest将JavaScript中的数据发送到python脚本中,以处理提取的数据并将结果发送回扩展,但这会使扩展速度变慢
或者,如果我不得不使用JavaScript创建分类器,如何使其持久化?如何出口
非常感谢您可以将其编译成JavaScript。或者单独运行并通过nativeMessaging API进行通信。请参阅文档。您可以将其编译为JavaScript。或者单独运行并通过nativeMessaging API进行通信。请参阅文档。