简体   繁体   English

如何部署机器学习模型以使用多个特征数据进行预测

[英]How to deploy machine learning model to predict with multiple feature data

I have a trained machine learning model need to be deploy. 我有一个训练有素的机器学习模型需要部署。 It is trained with mutltiple features but how to use that model to predict with multiple feature data. 它经过多特征训练,但是如何使用该模型对多个特征数据进行预测。 for example i need to use these feature data to predict the result 例如,我需要使用这些特征数据来预测结果

input = [46.8,11,7,0.686563,6.540829e-08,1.133174e-09]

i used following code but itseems predict() is working only for single feature data. 我使用了以下代码,但似乎预报()仅适用于单个要素数据。

from sklearn.externals import joblib
model = joblib.load('SVM_LINEAR')
model.predict([46.8,11,7,0.686563,6.540829e-08,1.133174e-09])

I think you need to make a numpy array of features and then pass it inside model.predict ie 我认为您需要制作一些特征的数组,然后将其传递到model.predict

import numpy as np
from sklearn.externals import joblib
model = joblib.load('SVM_LINEAR')
model.predict(np.asarray([46.8,11,7,0.686563,6.540829e-08,1.133174e-09]))

or you can try this: 或者您可以尝试以下操作:

import numpy as np
from sklearn.externals import joblib
model = joblib.load('SVM_LINEAR')
model.predict([[46.8,11,7,0.686563,6.540829e-08,1.133174e-09]])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使机器学习 model 具有一个多值特征 - How to make machine learning model with One multiple value feature 机器学习model根据列数据预测列名? - Machine learning model to predict column names based on column data? 如何为我训练有素的机器学习 model 提供输入以预测 output? - How to give input to my trained machine learning model to predict the output? 我们如何使用 Flask 部署机器学习 Model? - How can we deploy a Machine Learning Model using Flask? 如何在 django web 应用程序中部署机器学习模型? - How to deploy a machine learning model in a django web app? 如何在没有数据的情况下设置机器学习 model - How to set up a machine learning model with no data 如何在Google机器学习中预测图像 - How predict an image in google machine learning 部署端点 model Azure 机器学习失败 - Failed deploy endpoint model Azure Machine Learning python中具有多种功能类型的机器学习 - Machine learning with multiple feature types in python 如何统一使用 python 制造和训练的机器学习 model 来预测某些事情? - How to use a python made and trained machine learning model in unity to predict something?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM