The models in sklearn are objects, using Pickle to save and restore the trained classify or cluster models. Do not us numpy.save and numpy.load to do this, it’s not working.
from sklearn.cluster import Kmeans
# suppose we want to save this kmeans model
kmeans_results = KMeans(n_clusters=2).fit(X)
kmeans_results_file = "kmeans.pkl"
# saving results
with open(kmeans_results_file, 'wb') as f:
# loading results
with open(kmeans_results_file, 'rb') as f:
kmeans_results = pickle.load(f)