Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Bug in timeseries_anomalies function called regression_errors

Đang mở
#148 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
pandas, python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Bắt đầu trong analysis/timeseries_anomalies.py tại lệnh gọi regression_errors đến pandas ewm, sau đó tái hiện lỗi với phần chia NASA Telemanom T-10 được mô tả ở đây. Xác minh rằng smoothing span vẫn hợp lệ đối với tập kiểm thử gồm 24 mẫu và pipeline hoàn tất mà không gặp ValueError đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Pending Review
What I Did

I ran a pipeline with signal T-10 from the publicly available NASA Telemanom signal. My train/test split was 571 training samples and 24 testing samples. The code seems to be breaking because the span in ewm is int(len(y)*smoothing_window) = int(24*0.01) = int(0.24) = 0 which is less than 1. As per the pandas documentation span >= 1 (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.ewm.html)

One way to fix this is to add a max(1, int(len(y)*smoothing_window)) so that we never go below 1 for the span.

Traceback:
Traceback (most recent call last):
  File "run_pipelines.py", line 76, in <module>
    anoms = pipeline.predict(test)
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/mlblocks/mlpipeline.py", line 264, in predict
    outputs = block.produce(**produce_args)
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/mlblocks/mlblock.py", line 268, in produce
    return self.primitive(**produce_args)
  File "/home/itinawi/meng/IML-private/Orion/analysis/timeseries_anomalies.py", line 33, in regression_errors
    return pd.Series(errors).ewm(span=smoothing_window).mean().values
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/generic.py", line 8927, in ewm
    adjust=adjust, ignore_na=ignore_na, axis=axis)
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2489, in ewm
    return EWM(obj, **kwds)
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2074, in __init__
    self.com = _get_center_of_mass(com, span, halflife, alpha)
  File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2389, in _get_center_of_mass
    raise ValueError("span must satisfy: span >= 1")
ValueError: span must satisfy: span >= 1
Ngôn ngữ chính
Python
Star
70
Fork
37
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MLBazaar/MLPrimitives

Tất cả issue của MLBazaar/MLPrimitives

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.