dwavesystems / dwavesystems/dwave-scikit-learn-plugin
Consider multiplying the quadratic biases in `SelectFromQuadraticModel.correlation_cqm()` by `1-alpha`.
- 主要言語
- Python
- スター
- 18
- フォーク
- 16
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Currently, it is possible to construct a dataset where, even with `alpha=1`, a fixed or random column is chosen because of the penalties in the quadratic term. This contradicts [the docstring](https://github.com/dwavesystems/dwave-scikit-learn-plugin/blob/7db7d03c7b2b17db6309907069ade9aee0e4157a/dwave/plugins/sklearn/transformers.py#L132-L140) which claims
```
alpha:
Hyperparameter between 0 and 1 that controls the relative weight of
the relevance and redundancy terms.
``alpha=0`` places no weight on the quality of the features,
therefore the features will be selected as to minimize the
redundancy without any consideration to quality.
``alpha=1`` places the maximum weight on the quality of the features,
and therefore will be equivalent to using
:class:`sklearn.feature_selection.SelectKBest`.
```
One solution is to multiply the quadratic/redundany terms by `1-alpha` to ensure that they are zeroed when `alpha=1`.
For instance we could replace https://github.com/dwavesystems/dwave-scikit-learn-plugin/blob/7db7d03c7b2b17db6309907069ade9aee0e4157a/dwave/plugins/sklearn/transformers.py#L210-L212 with
```python
diag = np.array(correlations[:, -1] * (-2 * alpha * num_features), copy=True)
correlations *= (1-alpha)
# our objective
# we multiply by 2 because the matrix is symmetric
np.fill_diagonal(correlations, diag)
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Read dwave/plugins/sklearn/transformers.py, focusing on SelectFromQuadraticModel.correlation_cqm() and its alpha docstring. Check how the diagonal and quadratic redundancy terms are assembled, then verify that alpha=1 leaves only the quality terms and matches the documented SelectKBest behavior.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- numpy, python, scikit-learn
- 領域
- machine-learning
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100