mirror of
https://github.com/Doctorado-ML/mufs.git
synced 2025-08-15 15:45:53 +00:00
Update version number and sample
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from .Selection import MUFS
|
||||
|
||||
__version__ = "0.1.1"
|
||||
__version__ = "0.1.2"
|
||||
__author__ = "Ricardo Montañana Gómez"
|
||||
__author_email__ = "Ricardo.Montanana@alu.uclm.es"
|
||||
__copyright__ = "Copyright 2021, Ricardo Montañana Gómez"
|
||||
|
21
sample.py
21
sample.py
@@ -1,4 +1,5 @@
|
||||
import warnings
|
||||
import time
|
||||
from mufs import MUFS
|
||||
from mufs.Metrics import Metrics
|
||||
from stree import Stree
|
||||
@@ -26,16 +27,26 @@ for i in range(n):
|
||||
# Classification
|
||||
warnings.filterwarnings("ignore")
|
||||
print("CFS")
|
||||
now = time.time()
|
||||
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")
|
||||
fcfb_f = mufsc.fcbf(X, y, 5e-2).get_results()
|
||||
print(fcfb_f, len(fcfb_f))
|
||||
now = time.time()
|
||||
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)
|
||||
clf = Stree(random_state=0)
|
||||
print("Accuracy whole dataset", clf.fit(X, y).score(X, y))
|
||||
clf = Stree(random_state=0)
|
||||
print("Accuracy cfs", clf.fit(X[:, cfs_f], y).score(X[:, cfs_f], y))
|
||||
clf = Stree(random_state=0)
|
||||
subf = fcfb_f
|
||||
print("Accuracy fcfb", clf.fit(X[:, subf], y).score(X[:, subf], y))
|
||||
print("Accuracy fcfb", clf.fit(X[:, fcbf_f], y).score(X[:, fcbf_f], 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