How to save a trained model by scikit-learn? [duplicate]

You can use: 1. pickle from sklearn import svm from sklearn import datasets iris = datasets.load_iris() X, y = iris.data, iris.target clf = svm.SVC() clf.fit(X, y) ########################## # SAVE-LOAD using pickle # ########################## import pickle # save with open(‘model.pkl’,’wb’) as f: pickle.dump(clf,f) # load with open(‘model.pkl’, ‘rb’) as f: clf2 = pickle.load(f) clf2.predict(X[0:1]) 2. joblib … Read more

Is it possible to make a trainable variable not trainable?

After looking at the documentation and the code, I was not able to find a way to remove a Variable from the TRAINABLE_VARIABLES. Here is what happens: The first time tf.get_variable(‘weights’, trainable=True) is called, the variable is added to the list of TRAINABLE_VARIABLES. The second time you call tf.get_variable(‘weights’, trainable=False), you get the same variable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)