トピック抽出用の NMF モデルを構築しようとしています。モデルの再トレーニングのために、パラメーターを nmf 関数に渡す必要があります。これには、アルゴリズムが返す特定のポイントからの x 座標を渡す必要があります。参照用のコードは次のとおりです。
no_features = 1000
no_topics = 9
print ('Old number of topics: ', no_topics)
tfidf_vectorizer = TfidfVectorizer(max_df = 0.95, min_df = 2, max_features = no_features, stop_words = 'english')
tfidf = tfidf_vectorizer.fit_transform(documents)
tfidf_feature_names = tfidf_vectorizer.get_feature_names()
no_topics = tfidf.shape
print('New number of topics :', no_topics)
# nmf = NMF(n_components = no_topics, random_state = 1, alpha = .1, l1_ratio = .5, init = 'nndsvd').fit(tfidf)
最後の 3 行目で、tfidf.shape は変数 'no_topics' にポイント (3,1000) を返しますが、その変数を x 座標のみ、つまり (3) に設定したいと考えています。ポイントからx座標だけを抽出するにはどうすればよいですか?