Select specific measures and summaries

To customize the measure extraction, is necessary to use the feature and summary attribute. For instance, info-theo and and statistical compute the information theoretical and the statistical measures, respectively. The following examples illustrate how to run specific measues and summaries from them:

# Load a dataset
from sklearn.datasets import load_iris
from pymfe.mfe import MFE

data = load_iris()
y = data.target
X = data.data

Select specific measures and summaries for statistical

Extracting three information theoretical measures.

mfe = MFE(groups="all", features=["attr_ent", "joint_ent"],
          summary=["median", "min", "max"])
mfe.fit(X, y)
ft = mfe.extract()
print("\n".join("{:50} {:30}".format(x, y) for x, y in zip(ft[0], ft[1])))
attr_ent.max                                                   2.3156530476978263
attr_ent.median                                                2.3034401979164256
attr_ent.min                                                    2.186231666502969
joint_ent.max                                                   3.410577680708083
joint_ent.median                                               2.9901513033202027
joint_ent.min                                                  2.6820037088926547

Select specific measures and summaries for info-theo

Extracting two statistical measures.

mfe = MFE(groups="all", features=["can_cor", "cor", "iq_range"],
          summary=["median", "min", "max"])
mfe.fit(X, y)
ft = mfe.extract()
print("\n".join("{:50} {:30}".format(x, y) for x, y in zip(ft[0], ft[1])))
can_cor.max                                                    0.9848208927389822
can_cor.median                                                 0.7280089563896481
can_cor.min                                                   0.47119702004031394
cor.max                                                        0.9628654314027961
cor.median                                                     0.6231906153010576
cor.min                                                       0.11756978413300208
iq_range.max                                                   3.4999999999999996
iq_range.median                                                1.4000000000000004
iq_range.min                                                                  0.5

Select specific measures for both info-theo and statistical

Extracting five measures.

mfe = MFE(groups="all", features=["attr_ent", "joint_ent", "can_cor", "cor", "iq_range"],
          summary=["median", "min", "max"])
mfe.fit(X, y)
ft = mfe.extract()
print("\n".join("{:50} {:30}".format(x, y) for x, y in zip(ft[0], ft[1])))
attr_ent.max                                                   2.3156530476978263
attr_ent.median                                                2.3034401979164256
attr_ent.min                                                    2.186231666502969
can_cor.max                                                    0.9848208927389822
can_cor.median                                                 0.7280089563896481
can_cor.min                                                   0.47119702004031394
cor.max                                                        0.9628654314027961
cor.median                                                     0.6231906153010576
cor.min                                                       0.11756978413300208
iq_range.max                                                   3.4999999999999996
iq_range.median                                                1.4000000000000004
iq_range.min                                                                  0.5
joint_ent.max                                                   3.410577680708083
joint_ent.median                                               2.9901513033202027
joint_ent.min                                                  2.6820037088926547

Total running time of the script: ( 0 minutes 0.090 seconds)

Gallery generated by Sphinx-Gallery