![]() ![]() ONNX conversion code from skl2onnx import convert_sklearnįrom _types import FloatTensorType, StringTensorType Print(metrics.classification_report(y_test, y_pred,Ĭlf = OneVsOneClassifier(LinearSVC(random_state=42, class_weight='balanced'))Ĭ_res = pipeline.predict(create_test_data(rev)) Pipeline = Pipeline([('prep',column_trans), ![]() # Each pipeline uses the same column transformer. So to convert pipeline to ONNX format and then use for inferencing on 1 example.Ĭode: from sklearn.feature_extraction.text import TfidfVectorizerįrom pose import ColumnTransformerįrom sklearn.multiclass import OneVsRestClassifier, OneVsOneClassifier Currently, it’s slow, ~1second for 1 inference. Without changing the training pipeline or parameters, note the inference time. I convert these intents in labels using: le = LabelEncoder() Its a multi-class classification problem. I am using OneVsOneClassifier model to train and predict 150 intents. It is a multi-class classification model with sklearn.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |