I am using a DBN (deep belief network) from nolearn based on scikit-learn.
I have already built a Network which can classify my data very well, now I am interested in ex
The section 3.4. Model persistence in scikit-learn documentation covers pretty much everything.
In addition to sklearn.externals.joblib ogrisel pointed to, it shows how to use the regular pickle package:
>>> from sklearn import svm
>>> from sklearn import datasets
>>> clf = svm.SVC()
>>> iris = datasets.load_iris()
>>> X, y = iris.data, iris.target
>>> clf.fit(X, y)
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
kernel='rbf', max_iter=-1, probability=False, random_state=None,
shrinking=True, tol=0.001, verbose=False)
>>> import pickle
>>> s = pickle.dumps(clf)
>>> clf2 = pickle.loads(s)
>>> clf2.predict(X[0])
array([0])
>>> y[0]
0
and gives a few warnings such as models saved in one version of scikit-learn might not load in another version.