Problems running the examples
See original GitHub issueHi,
cool project! I tried to run the examples but I run into errors.
I think that might be due to different package versions I use (mainly pandas
and six
). Would you be so kind and provide me with the version numbers you used back then.
Error in movielens_preprocess:
----> 1 movie = movie_preprocessing(movie)
<ipython-input-7-0d79f909437b> in movie_preprocessing(movie)
21 tag_table = {token: idx for idx, token in enumerate(set(itertools.chain.from_iterable(movie_tag)))}
22 movie_tag = pd.DataFrame(movie_tag)
---> 23 tag_table = pd.DataFrame(tag_table.items())
~/Environments/py3old/lib/python3.6/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
300 copy=False)
301 else:
--> 302 raise PandasError('DataFrame constructor not properly called!')
303
304 NDFrame.__init__(self, mgr, fastpath=True)
PandasError: DataFrame constructor not properly called!
I could solve that replacing
tag_table = pd.DataFrame(tag_table.items())
with
tag_table=pd.DataFrame.from_dict(tag_table, orient='index')
tag_table.reset_index(level=0, inplace=True)
Error in movielens_bandit:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-9-263240bbee7e> in <module>()
----> 1 main()
<ipython-input-8-745ae3df14c6> in main()
143 i = 0
144 for bandit in experiment_bandit:
--> 145 policy = policy_generation(bandit, actions)
146 seq_error = policy_evaluation(policy, bandit, streaming_batch_small, user_feature, reward_list,
147 actions, action_context)
<ipython-input-8-745ae3df14c6> in policy_generation(bandit, actions)
41
42 elif bandit == 'LinUCB':
---> 43 policy = linucb.LinUCB(actions, historystorage, modelstorage, 0.3, 20)
44
45 elif bandit == 'LinThompSamp':
~/Environments/py3old/lib/python3.6/site-packages/striatum/bandit/linucb.py in __init__(self, history_storage, model_storage, action_storage, recommendation_cls, context_dimension, alpha)
69 'theta': {},
70 }
---> 71 for action_id in self._action_storage.iterids():
72 self._init_action_model(model, action_id)
73
AttributeError: 'MemoryModelStorage' object has no attribute 'iterids'
Many thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Problem Running Basic Example B1 - Geant4 Forum
All, I just installed GEANT4 on my MacBook. The installation appeared to be successful. However, when I tried to run basic example B1...
Read more >Trouble running the example · Issue #1 - GitHub
When running the example as it's written in readme, I'm getting the following errors, like it's missing some files:.
Read more >Compiling and Running the Examples: FAQs
Compiling and Running the Examples: FAQs. How do I compile and run the examples? Why do I get an error message when I...
Read more >Having problems running the example - Docker Hub
I run the command in both an Admin cmd prompt and admin Windows Powershell with same results. My google searches haven't come up...
Read more >Problems running the WPILib RamseteCommand example
My team is trying to implement Ramsetes pathing this year. We are using C++, the Command robot style, and have TalonFX motors and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
modify movielens_bandit.py:
1.policy = linucb.LinUCB(history_storage=historystorage, model_storage=modelstorage,action_storage=actions, alpha=0.3, context_dimension=18) 2.action[0][‘action’].action_id as action[0].action.id
Just combine the previous two fix and get the example works. Feel free to pull from my forked.