Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix range count config #827

Merged
merged 1 commit into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/units/feature_extraction/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class TestSettingsObject(TestCase):
This tests the base class ComprehensiveFCParameters
"""

def test_range_count_correctly_configured(self):
fset = ComprehensiveFCParameters()
params_range_count = fset["range_count"]
for param in params_range_count:
assert param["min"] < param["max"]

def test_from_column_raises_on_wrong_column_format(self):

self.assertRaises(TypeError, from_columns, 42)
Expand Down
3 changes: 2 additions & 1 deletion tsfresh/feature_extraction/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def __init__(self):
product(["real", "imag", "abs", "angle"], range(100))],
"fft_aggregated": [{"aggtype": s} for s in ["centroid", "variance", "skew", "kurtosis"]],
"value_count": [{"value": value} for value in [0, 1, -1]],
"range_count": [{"min": -1, "max": 1}, {"min": 1e12, "max": 0}, {"min": 0, "max": 1e12}],
"range_count": [{"min": -1, "max": 1}, {"min": -1e12, "max": 0},
{"min": 0, "max": 1e12}],
"approximate_entropy": [{"m": 2, "r": r} for r in [.1, .3, .5, .7, .9]],
"friedrich_coefficients": (lambda m: [{"coeff": coeff, "m": m, "r": 30} for coeff in range(m + 1)])(3),
"max_langevin_fixed_point": [{"m": 3, "r": 30}],
Expand Down