0
私はPipeline
オブジェクトを用意していますので、fit
オブジェクトを使用してさまざまな予測を作成してください。しかし、私は、fit
は、同じクラシファイアオブジェクトを使用して、以前のfit
オブジェクトを取り除くと信じています。適合モデルのロジスティック回帰オブジェクトを再利用する
私のコードの例は次のとおりです。
text_clf = Pipeline([('vect', CountVectorizer(analyzer="word",tokenizer=None,preprocessor=None,stop_words=None,max_features=5000)),
('tfidf', TfidfTransformer(use_idf=True,norm='l2',sublinear_tf=True)),
('clf',LogisticRegression(solver='newton-cg',class_weight='balanced', multi_class='multinomial',fit_intercept=True),
)])
print "Fitting the open multinomial BoW logistic regression model for probability models...\n"
open_multi_logit_words = text_clf.fit(train_wordlist, train_property_labels)
print "Fitting the open multinomial BoW logistic regression model w/ ",threshold," MAPE threshold...\n"
open_multi_logit_threshold_words = (text_clf.copy.deepcopy()).fit(train_wordlist, train_property_labels_threshold)
しかし、分類器オブジェクトはdeepcopy()
メソッドを持っていません。
text_clf_open_multi_logit = Pipeline([('vect', CountVectorizer(analyzer="word",tokenizer=None,preprocessor=None,stop_words=None,max_features=5000)),
('tfidf', TfidfTransformer(use_idf=True,norm='l2',sublinear_tf=True)),
('clf',LogisticRegression(solver='newton-cg',class_weight='balanced', multi_class='multinomial',fit_intercept=True),
)])
私の16個の分類器の組み合わせはどれですか?
を使用することができます。私は16 +モデルのためにその行をコピーする必要があるので: –
1,2,3などを使用して –
それは、あなたのトレースバックを投稿 – marmouset