Skip to content

Commit

Permalink
Merge pull request #81 from ealcobaca/complexity-fts
Browse files Browse the repository at this point in the history
New complexity metafeatures
  • Loading branch information
ealcobaca committed Jul 1, 2020
2 parents 347c7ae + 7b93954 commit 07e2500
Show file tree
Hide file tree
Showing 4 changed files with 2,219 additions and 265 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pypi: clean ## Send the package to pypi.
twine upload dist/*

install-dev: ## Install pymfe for developers using pip.
pip install -e .
pip install -U -e .
pip install -U -r requirements.txt
pip install -U -r requirements-dev.txt
pip install -U -r requirements-docs.txt
Expand Down
8 changes: 7 additions & 1 deletion pymfe/_utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
"""Keeps generic utility functions."""
import typing as t

import numpy as np


def calc_cls_inds(y: np.ndarray, classes: np.ndarray) -> np.ndarray:
def calc_cls_inds(y: np.ndarray,
classes: t.Optional[np.ndarray] = None) -> np.ndarray:
"""Compute the ``cls_inds`` variable.
The ``cls_inds`` variable is a boolean array which marks with
True value whether the instance belongs to each class. Each
distinct class is represented by a row, and each instance is
represented by a column.
"""
if classes is None:
classes = np.unique(y)

cls_inds = np.array([np.equal(y, cur_cls) for cur_cls in classes],
dtype=bool)

Expand Down

0 comments on commit 07e2500

Please sign in to comment.