[英]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.