我正在研究以下sklearn管道。
pipeline = Pipeline([
('PreProcess', TweetPreprocessor()),
# Use FeatureUnion to combine the features
('union', FeatureUnion(
transformer_list =[
('tweet_ngrams', Pipeline([
('selector', ItemSelector(key='tweets')),
('tfidf', TfidfVectorizer(ngram_range =(1, 2), analyzer='word')),
])
),
('tweet_features', Pipeline(
[('selector', ItemSelector(key='tweets')),
('stats', TextStats()), # returns a list of dicts
('vect', DictVectorizer()), # list of dicts -> feature matrix
]
)
),
],
)),
# Use a SVC classifier on the combined features
('svc', SVC(kernel='linear')),])
clf.coef_给了我
现在,当我运行以下代码时。它给了我索引超出范围的错误。我尝试重塑,但没有帮助。
vect.inverse_transform(clf.coef_)
我希望找回有助于分类的功能。预先感谢。