mirror of
https://github.com/Doctorado-ML/STree.git
synced 2025-08-15 23:46:02 +00:00
Fix random seed not used in fs_mutual
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest]
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
python: [3.8]
|
||||
|
||||
steps:
|
||||
|
@@ -367,9 +367,8 @@ class Splitter:
|
||||
.get_support(indices=True)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _fs_mutual(
|
||||
dataset: np.array, labels: np.array, max_features: int
|
||||
self, dataset: np.array, labels: np.array, max_features: int
|
||||
) -> tuple:
|
||||
"""Return the best features with mutual information with labels
|
||||
|
||||
@@ -389,7 +388,9 @@ class Splitter:
|
||||
indices of the features selected
|
||||
"""
|
||||
# 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(
|
||||
sorted(
|
||||
range(len(feature_list)), key=lambda sub: feature_list[sub]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
from .Strees import Stree, Siterator
|
||||
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.2.3"
|
||||
|
||||
__author__ = "Ricardo Montañana Gómez"
|
||||
__copyright__ = "Copyright 2020-2021, Ricardo Montañana Gómez"
|
||||
|
Reference in New Issue
Block a user