Don't maintain state for some objects

Đang mở
#329 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
stream-processing

Hướng nghiên cứu

Start by reading how stream objects store and propagate state, then compare that behavior with the saveStreamState and restoreStreamState examples in the issue. Define the native behavior around temporarily using current data for predictions without accumulating it, and verify that normal feature rows still update rolling state.

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

Mô tả

Hey, thanks for this library, it's great. I'm building an ML application that is learning in an online way. So, it's constantly acquiring new feature rows, but also having to serve up predictions at the same time. I want to use Streamz to accumulate data, however, for my real feature rows, I want the accumulators to maintain state (say, a rolling mean). But for my predictions, I don't want the state to get accumulated into the roller.

As an example, let's say i'm recording temperature measurements once every 15 seconds. Every 15 seconds I want to generate a new feature vector that contains the rolling mean of the last 25 temperatures. However, inside of that 15 second window, I may get asked to serve up a prediction, for which I want to use the current temperature in the rolling mean, but I don't want the current temperature to be accumulated into the roller's state.

Is there a straightforward way to do this currently?

EDIT: For now i'm doing this:

    state = None
    if hasattr(stream, 'state'):
        state = stream.state
    
    return {
        'state': state,
        'children': [saveStreamState(s) for s in stream.downstreams]
    }


def restoreStreamState(stream, stateTree):
    stream.state = stateTree['state']
    for subStream, subTree in zip(stream.downstreams, stateTree['children']):
        restoreStreamState(subStream, subTree)

Which seems to work. It'd be cool if there was some way to do it natively, though.

Ngôn ngữ chính
Python
Star
1.3k
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 python-streamz/streamz

Tất cả issue của python-streamz/streamz

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.