mirror of
https://github.com/Doctorado-ML/STree.git
synced 2025-08-16 07:56:06 +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 }}
|
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:
|
||||||
|
@@ -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]
|
||||||
|
@@ -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"
|
||||||
|
Reference in New Issue
Block a user