mirror of
https://github.com/Doctorado-ML/mufs.git
synced 2025-08-18 09:05:54 +00:00
Fix some tests
This commit is contained in:
22
mfs/k.py
Normal file
22
mfs/k.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sklearn.datasets import load_wine
|
||||
from mfs import MFS
|
||||
from mfs.Metrics import Metrics
|
||||
|
||||
mfsc = MFS(discrete=False)
|
||||
mfsd = MFS(discrete=True)
|
||||
X, y = load_wine(return_X_y=True)
|
||||
m, n = X.shape
|
||||
|
||||
print("* Differential entropy in X")
|
||||
for i in range(n):
|
||||
print(i, Metrics.differential_entropy(X[:, i], k=10))
|
||||
|
||||
print("* Information Gain")
|
||||
print("- Discrete features")
|
||||
print(Metrics.information_gain(X, y))
|
||||
for i in range(n):
|
||||
print(i, Metrics.information_gain(X[:, i], y))
|
||||
print("- Continuous features")
|
||||
# print(Metrics.information_gain_cont(X, y))
|
||||
for i in range(n):
|
||||
print(i, Metrics.information_gain_cont(X[:, i], y))
|
Reference in New Issue
Block a user