문제

I have standardized my data in sklearn using preprocessing.standardscaler. Question is how could I save this in my local for latter use?

Thanks

도움이 되었습니까?

해결책

If I understand you correctly you want to save your trained model so it can be loaded again correct?

There are two methods, using python's pickle and the other method which is to use joblib. The recommend method is joblib as this will result in a much smaller file than a pickle, which dumps a string representation of your object:

from sklearn.externals import joblib
joblib.dump(clf, 'filename.pkl') 

#then load it later, remember to import joblib of course

clf = joblib.load('filename.pk1')

See the online docs

Note: sklearn.externals.joblib is deprecated. Install and use the pure joblib instead

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top