Don't maintain state for some objects
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- stream-processing
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-streamz/streamz
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
python-streamz/streamz#481 · 4 comments ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter? Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-streamz/streamz#480 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
python-streamz/streamz#479 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
python-streamz/streamz#478 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 10/100
python-streamz/streamz#476 · 17 comments · 2 reactions ·
All issues in python-streamz/streamz
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100