Showing 138 of 185 total issues
File classification.py
has 884 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Module for classification function."""
import functools
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
File _estimators.py
has 813 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from joblib import Parallel, delayed
from sklearn.base import (
BaseEstimator,
TransformerMixin,
File estimation.py
has 792 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Estimation of SPD matrices."""
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.covariance import shrunk_covariance
from sklearn.metrics.pairwise import pairwise_kernels
File mean.py
has 693 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Means of SPD/HPD matrices."""
from copy import deepcopy
import numpy as np
import warnings
File covariance.py
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
import warnings
from functools import wraps
import numpy as np
from scipy.linalg import block_diag
File clustering.py
has 666 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Clustering functions."""
import numpy as np
from joblib import Parallel, delayed
from scipy.stats import norm, chi2
import sklearn
File spatialfilters.py
has 642 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Spatial filtering function."""
import warnings
import numpy as np
from scipy.linalg import eigh, inv
File distance.py
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Distances between SPD/HPD matrices."""
import numpy as np
from scipy.linalg import eigvalsh, solve
from sklearn.metrics import euclidean_distances
File sampling.py
has 467 lines of code (exceeds 250 allowed). Consider refactoring. Open
from functools import partial
import warnings
import numpy as np
from scipy.stats import multivariate_normal
from sklearn.utils import check_random_state
File embedding.py
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Embedding SPD matrices via manifold learning techniques."""
import warnings
import numpy as np
File stats.py
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
import sys
import math
import numpy as np
from sklearn.model_selection import cross_val_score
File simulated.py
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from sklearn.utils.validation import check_random_state
from ..utils.mean import mean_riemann
from ..utils.distance import distance_riemann
Function plot_waveforms
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def plot_waveforms(X, display, *, times=None, color="gray", alpha=0.5,
linewidth=1.5, color_mean="k", color_std="gray", n_bins=50,
cmap=None):
"""Plot repetitions of a multichannel waveform.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File tangentspace.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Tangent space for SPD/HPD matrices."""
import numpy as np
from .base import sqrtm, invsqrtm, logm, expm
File ajd.py
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Aproximate joint diagonalization algorithms."""
import numpy as np
import warnings
File viz.py
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Helpers for vizualization."""
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
import numpy as np
File tangentspace.py
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Tangent space functions."""
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
Function cross_spectrum
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def cross_spectrum(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None):
"""Compute the complex cross-spectral matrices of a real signal X.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fit
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def fit(self, X, y):
"""Train CSP spatial filters.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function covariance_mest
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def covariance_mest(X, m_estimator, *, init=None, tol=10e-3, n_iter_max=50,
assume_centered=False, q=0.9, nu=5, norm="trace"):
r"""Robust M-estimators.
Robust M-estimator based covariance matrix [1]_, computed by fixed point
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"