pyccea.decomposition package

class pyccea.decomposition.ClusteringFeatureGrouping(n_subcomps: int = None, clusters: ndarray = array([], dtype=float64))[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to a clustering.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Feature indexes sorted according to clustering. It is passed as a parameter if it has been previously generated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray, default None

Feature indexes sorted according to clustering. For example, if the first subpopulation has size x, the first x elements of this list will be the features of the first subcomponent and so on.

class pyccea.decomposition.DummyFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], feature_idxs: ndarray = None)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to preset indexes.

Methods

decompose(X)

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

Returns:
subcomponentslist

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxsnp.ndarray, default None

Indexes of features sorted according to a predetermined method.

class pyccea.decomposition.FeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [])[source]

Bases: ABC

An abstract class for a feature grouping approach.

class pyccea.decomposition.RandomFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], seed: int = None)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) randomly.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None) tuple[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Shuffled list of feature indexes. It is passed as a parameter if it has been previously generated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray

Shuffled list of feature indexes.

class pyccea.decomposition.RankingFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], scores: ndarray = array([], dtype=float64), method: str = None, ascending: bool = True)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to a score-based method.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Indexes of features sorted according to the score. It is passed as a parameter if it has been previously calculated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray, default None

Indexes of features sorted according to the score.

methods = ['distributed', 'elitist']
class pyccea.decomposition.SequentialFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [])[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) sequentially.

Methods

decompose(X)

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
Xnp.ndarray

n-dimensional input data.

Returns:
subcomponentslist

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxsnp.ndarray

List of feature indexes starting from 0 to n_features-1.

Submodules

pyccea.decomposition.clustering module

class pyccea.decomposition.clustering.ClusteringFeatureGrouping(n_subcomps: int = None, clusters: ndarray = array([], dtype=float64))[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to a clustering.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Feature indexes sorted according to clustering. It is passed as a parameter if it has been previously generated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray, default None

Feature indexes sorted according to clustering. For example, if the first subpopulation has size x, the first x elements of this list will be the features of the first subcomponent and so on.

pyccea.decomposition.dummy module

class pyccea.decomposition.dummy.DummyFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], feature_idxs: ndarray = None)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to preset indexes.

Methods

decompose(X)

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

Returns:
subcomponentslist

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxsnp.ndarray, default None

Indexes of features sorted according to a predetermined method.

pyccea.decomposition.grouping module

class pyccea.decomposition.grouping.FeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [])[source]

Bases: ABC

An abstract class for a feature grouping approach.

pyccea.decomposition.random module

class pyccea.decomposition.random.RandomFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], seed: int = None)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) randomly.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None) tuple[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Shuffled list of feature indexes. It is passed as a parameter if it has been previously generated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray

Shuffled list of feature indexes.

pyccea.decomposition.ranking module

class pyccea.decomposition.ranking.RankingFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [], scores: ndarray = array([], dtype=float64), method: str = None, ascending: bool = True)[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) according to a score-based method.

Methods

decompose(X[, feature_idxs])

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray, feature_idxs: ndarray = None)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
X: np.ndarray

n-dimensional input data.

feature_idxs: np.ndarray, default None

Indexes of features sorted according to the score. It is passed as a parameter if it has been previously calculated.

Returns:
subcomponents: list

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxs: np.ndarray, default None

Indexes of features sorted according to the score.

methods = ['distributed', 'elitist']

pyccea.decomposition.static module

class pyccea.decomposition.static.SequentialFeatureGrouping(n_subcomps: int = None, subcomp_sizes: list = [])[source]

Bases: FeatureGrouping

Decompose the problem (a collection of features) sequentially.

Methods

decompose(X)

Divide an n-dimensional problem into m subproblems.

decompose(X: ndarray)[source]

Divide an n-dimensional problem into m subproblems.

Parameters:
Xnp.ndarray

n-dimensional input data.

Returns:
subcomponentslist

Subcomponents, where each subcomponent is an array that can be accessed by indexing the list.

feature_idxsnp.ndarray

List of feature indexes starting from 0 to n_features-1.