Mastering Development

How to use state space model to do prediction for dataset with multiple specific columns/variables

I have a dataset as below: import pandas as pd from datetime import datetime, timedelta def date_range(start, end): r = (end+timedelta(days=1)-start).days return [start+timedelta(days=i) for i in range(r)] start = pd.to_datetime(‘2020-01-15’) end = pd.to_datetime(‘2020-02-13’) a = pd.DataFrame({‘date’: date_range(start, end), ‘group’: [0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2], ‘type’:[‘king’, ‘name’,’is’,’true’, ‘man’, ‘king’, ‘name’,’is’,’true’, ‘man’, ‘king’, ‘name’,’is’,’true’, ‘man’, ‘king’, ‘name’,’is’,’true’, ‘man’, ‘king’, ‘name’,’is’,’true’, ‘man’, […]