mirror of
https://github.com/Doctorado-ML/mufs.git
synced 2025-08-18 17:15:52 +00:00
Compare commits
2 Commits
Add-IWSS-(
...
v0.1.2
Author | SHA1 | Date | |
---|---|---|---|
a0f172ac13
|
|||
|
cfb37d2f6c |
@@ -1,6 +1,6 @@
|
|||||||
from .Selection import MUFS
|
from .Selection import MUFS
|
||||||
|
|
||||||
__version__ = "0.1.1"
|
__version__ = "0.1.2"
|
||||||
__author__ = "Ricardo Montañana Gómez"
|
__author__ = "Ricardo Montañana Gómez"
|
||||||
__author_email__ = "Ricardo.Montanana@alu.uclm.es"
|
__author_email__ = "Ricardo.Montanana@alu.uclm.es"
|
||||||
__copyright__ = "Copyright 2021, Ricardo Montañana Gómez"
|
__copyright__ = "Copyright 2021, Ricardo Montañana Gómez"
|
||||||
|
21
sample.py
21
sample.py
@@ -1,4 +1,5 @@
|
|||||||
import warnings
|
import warnings
|
||||||
|
import time
|
||||||
from mufs import MUFS
|
from mufs import MUFS
|
||||||
from mufs.Metrics import Metrics
|
from mufs.Metrics import Metrics
|
||||||
from stree import Stree
|
from stree import Stree
|
||||||
@@ -26,16 +27,26 @@ for i in range(n):
|
|||||||
# Classification
|
# Classification
|
||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
print("CFS")
|
print("CFS")
|
||||||
|
now = time.time()
|
||||||
cfs_f = mufsc.cfs(X, y).get_results()
|
cfs_f = mufsc.cfs(X, y).get_results()
|
||||||
print(cfs_f)
|
time_cfs = time.time() - now
|
||||||
|
print(cfs_f, "items: ", len(cfs_f), f"time: {time_cfs:.3f} seconds")
|
||||||
print("FCBF")
|
print("FCBF")
|
||||||
fcfb_f = mufsc.fcbf(X, y, 5e-2).get_results()
|
now = time.time()
|
||||||
print(fcfb_f, len(fcfb_f))
|
fcbf_f = mufsc.fcbf(X, y, 0.07).get_results()
|
||||||
|
time_fcbf = time.time() - now
|
||||||
|
print(fcbf_f, "items: ", len(fcbf_f), f"time: {time_fcbf:.3f} seconds")
|
||||||
|
now = time.time()
|
||||||
|
print("IWSS")
|
||||||
|
iwss_f = mufsc.iwss(X, y, 0.5).get_results()
|
||||||
|
time_iwss = time.time() - now
|
||||||
|
print(iwss_f, "items: ", len(iwss_f), f"time: {time_iwss:.3f} seconds")
|
||||||
print("X.shape=", X.shape)
|
print("X.shape=", X.shape)
|
||||||
clf = Stree(random_state=0)
|
clf = Stree(random_state=0)
|
||||||
print("Accuracy whole dataset", clf.fit(X, y).score(X, y))
|
print("Accuracy whole dataset", clf.fit(X, y).score(X, y))
|
||||||
clf = Stree(random_state=0)
|
clf = Stree(random_state=0)
|
||||||
print("Accuracy cfs", clf.fit(X[:, cfs_f], y).score(X[:, cfs_f], y))
|
print("Accuracy cfs", clf.fit(X[:, cfs_f], y).score(X[:, cfs_f], y))
|
||||||
clf = Stree(random_state=0)
|
clf = Stree(random_state=0)
|
||||||
subf = fcfb_f
|
print("Accuracy fcfb", clf.fit(X[:, fcbf_f], y).score(X[:, fcbf_f], y))
|
||||||
print("Accuracy fcfb", clf.fit(X[:, subf], y).score(X[:, subf], y))
|
clf = Stree(random_state=0)
|
||||||
|
print("Accuracy iwss", clf.fit(X[:, iwss_f], y).score(X[:, iwss_f], y))
|
||||||
|
Reference in New Issue
Block a user