scikit-learn を使用した回帰問題に Recursive Feature Elimination のようなラッパー メソッドを適用したいと考えています。相互検証を使用した再帰的な機能の除去は、機能の数を自動的に調整する方法についての良い概要を提供します。
私はこれを試しました:
modelX = LogisticRegression()
rfecv = RFECV(estimator=modelX, step=1, scoring='mean_absolute_error')
rfecv.fit(df_normdf, y_train)
print("Optimal number of features : %d" % rfecv.n_features_)
# Plot number of features VS. cross-validation scores
plt.figure()
plt.xlabel("Number of features selected")
plt.ylabel("Cross validation score (nb of correct classifications)")
plt.plot(range(1, len(rfecv.grid_scores_) + 1), rfecv.grid_scores_)
plt.show()`
しかし、次のようなエラーメッセージが表示されます
`The least populated class in y has only 1 members, which is too few.
The minimum number of labels for any class cannot be less than n_folds=3. % (min_labels, self.n_folds)), Warning)
警告は分類の問題があるように聞こえますが、私のタスクは回帰の問題です。結果を得るにはどうすればよいですか?何が問題なのですか?