Fix random seed not used in fs_mutual

This commit is contained in:
2021-11-04 10:04:30 +01:00
parent b044a057df
commit cc931d8547
3 changed files with 6 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [macos-latest, ubuntu-latest] os: [macos-latest, ubuntu-latest, windows-latest]
python: [3.8] python: [3.8]
steps: steps:

View File

@@ -367,9 +367,8 @@ class Splitter:
.get_support(indices=True) .get_support(indices=True)
) )
@staticmethod
def _fs_mutual( def _fs_mutual(
dataset: np.array, labels: np.array, max_features: int self, dataset: np.array, labels: np.array, max_features: int
) -> tuple: ) -> tuple:
"""Return the best features with mutual information with labels """Return the best features with mutual information with labels
@@ -389,7 +388,9 @@ class Splitter:
indices of the features selected indices of the features selected
""" """
# return best features with mutual info with the label # return best features with mutual info with the label
feature_list = mutual_info_classif(dataset, labels) feature_list = mutual_info_classif(
dataset, labels, random_state=self._random_state
)
return tuple( return tuple(
sorted( sorted(
range(len(feature_list)), key=lambda sub: feature_list[sub] range(len(feature_list)), key=lambda sub: feature_list[sub]

View File

@@ -1,6 +1,6 @@
from .Strees import Stree, Siterator from .Strees import Stree, Siterator
__version__ = "1.2.2" __version__ = "1.2.3"
__author__ = "Ricardo Montañana Gómez" __author__ = "Ricardo Montañana Gómez"
__copyright__ = "Copyright 2020-2021, Ricardo Montañana Gómez" __copyright__ = "Copyright 2020-2021, Ricardo Montañana Gómez"