better sample k

This commit is contained in:
2021-06-02 01:51:22 +02:00
parent 96098e9fe1
commit 365b9b6668

View File

@@ -1,6 +1,7 @@
from sklearn.datasets import load_wine
from mfs import MFS
from mfs.Metrics import Metrics
from stree import Stree
mfsc = MFS(discrete=False)
mfsd = MFS(discrete=True)
@@ -23,8 +24,16 @@ for i in range(n):
print("CFS Discrete")
print(mfsd.cfs(X, y).get_results())
print("CFS continuous")
print(mfsc.cfs(X, y).get_results())
cfs_f = mfsc.cfs(X, y).get_results()
print(cfs_f)
print("FCBF Discrete")
print(mfsd.fcbf(X, y, 1e-7).get_results())
print("FCBF continuous")
print(mfsc.fcbf(X, y, 1e-7).get_results())
fcfb_f = mfsc.fcbf(X, y, 1e-7).get_results()
print(fcfb_f)
clf = Stree(random_state=0)
print("completo", clf.fit(X, y).score(X, y))
clf = Stree(random_state=0)
print("cfs", clf.fit(X[:, cfs_f], y).score(X[:, cfs_f], y))
clf = Stree(random_state=0)
print("fcfb", clf.fit(X[:, fcfb_f], y).score(X[:, fcfb_f], y))