Showing 43 of 45 total issues
File stacked_lstm.py
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file contains the stacked version LSTM model for time series forecasting.
"""
import sys
from pprint import pprint
Function fit
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def fit(
self,
data: Dict[str, np.ndarray],
ret: Union[None, List[str], "all"] = None,
save_to_disk: bool = False
- 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 optimizer.py
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Created: Dec. 24 2018
The baseline genetic optimizer.
"""
from typing import Callable, Dict, List, Tuple, Union, Iterable
Function core
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def core(
profile_record: dict,
raw_df: pd.DataFrame,
verbose: bool,
# set verbose=False when running hyper-parameter search.
- 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 cross_over
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def cross_over(
self,
p1: Dict[str, object],
p2: Dict[str, object]
) -> Tuple[dict]:
- 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 mutate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def mutate(
self,
chromosome: Dict[str, object],
mutate_prob: float = 0.05,
factor_cap: Union[List[Union[float, int]], None] = [0.50, 2.0]
- 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 core
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def core(
profile_record: dict,
raw_df: pd.DataFrame,
verbose: bool,
# set verbose=False when running hyper-parameter search.
- 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 advanced_visualize
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def advanced_visualize(
file_dir: str, # Dataset directory.
target: str,
load_multi_ex: callable,
CON_config: dict,
Function core
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def core(
Function core
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def core(
Function exec_core
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def exec_core(
param: Dict[str, object],
data: Dict[str, np.ndarray],
prediction_checkpoints: Iterable[int] = [-1],
verbose: bool = True
- 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 train_op
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def train_op(
optimizer,
total_gen: int,
elite: Union[int, float] = 1,
write_to_disk: Union[None, str] = None
- 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 cross_over
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def cross_over(
self,
p1: Dict[str, Union[str, float, int]],
p2: Dict[str, Union[str, float, int]]
) -> [dict, dict]:
- 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 __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function exec_core
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def exec_core(
parameters: Dict[str, object],
data_collection: Dict[str, np.ndarray],
clip_grad: float=None,
prediction_checkpoints: Iterable[int]=[-1]
- 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 __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
series: pd.Series,
config: dict = { # This is the default config for rapid testing.
"method": "diff",
Function _build_optimizer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _build_optimizer(self) -> None:
"""
A helper func. building the optimizer in neural network.
"""
if self.verbose:
- 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 advanced_visualize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def advanced_visualize(
Function generate_supervised_learning
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_supervised_learning(
self,
data: pd.DataFrame,
time_steps: int,
drop_target: bool=False) -> (
- 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"