category.
> > I also tried downloading the 0.13 version from source and installing it.
This
> > time I see a different error. The steps to reproduce for version 0.13 in
ipython
> > are as follows:
> You can not necessarily load a classifier that was trained with one
> version in another version.
> Could you try retraining with 0.13-git and see if the error persists?
Will try again with retraining on 0.13. Regarding the previous comment, I
apologize, it was my mistake, we are using Tfidfvectorizer in the original
source. But the issue seen is still the same, I will update the code in the
issue too.
--------------------------------------------------------------
# Train the classifier on a dataset of text
# documents with
# OneVsRestClassifier(SGDClassifier(loss=log, n_iter=35))
# Classifier object dumped using joblib.dump,
# without compression, for later use.
# Load vectorizer to be used for getting the document vector.
# TfidfVectorizer(stop_words='english', smooth_idf=True,
# sublinear_tf=True, token_pattern=ur'\b(?!\d)\w\w+\b',
# ngram_range=(1, 2), use_idf=False)
print 'Loading vectorizer...'
vectorizer = joblib.load("/home/n7/classifier/vectorizer.joblib")
print 'Loading classifier...'
classifier = joblib.load("/home/n7/classifier/classifier.joblib")
with open("topredict.txt") as f:
document = f.read()
document_vector = vectorizer.transform([document])
predict=classifier.predict(document_vector)
--------------------------------------------------------------
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general