Tôi hơi bối rối về cách tôi lưu một trình phân loại được đào tạo. Như trong, đào tạo lại một phân loại mỗi khi tôi muốn sử dụng nó rõ ràng là thực sự xấu và chậm, làm thế nào để tôi lưu nó và tải nó một lần nữa khi tôi cần nó? Mã dưới đây, cảm ơn trước sự giúp đỡ của bạn. Tôi đang sử dụng Python với NLTK Naive Bayes Classifier.Lưu phân loại Naive Bayes được đào tạo trong NLTK
classifier = nltk.NaiveBayesClassifier.train(training_set)
# look inside the classifier train method in the source code of the NLTK library
def train(labeled_featuresets, estimator=nltk.probability.ELEProbDist):
# Create the P(label) distribution
label_probdist = estimator(label_freqdist)
# Create the P(fval|label, fname) distribution
feature_probdist = {}
return NaiveBayesClassifier(label_probdist, feature_probdist)
Có phải y ou yêu cầu một số loại chiến lược kiên trì? Như trong lưu vào DB, tập tin và tải lại? Bạn chỉ có thể chọn dữ liệu và tải lại sau. – EdChum