Repository: plurai-ai/intellagent
Issue: error in 'A table of policies scores in the selected experiments' for multiple experiments
Root cause: Validation Gap

I ran the education and airline examples twice each and tried to visualize results in the streamlit UI. The 'Comparison of Experiments success rate' graph shows two plots as expected but the table of policies fails on a call to _color_arrow in '1_Experiments_Report.py' where 'val' is None type.

Steps to reproduce: Run an example twice, run the Streamlit visualizer, and set the Database path to, for example,

```
results/education/datasets
```

Expected behavior: It produces a table of policies scores.

Result: Error

```
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Traceback:
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/home/brian/intellagent/simulator/visualization/pages/1_📈_Experiments_Report.py", line 260, in <module>
    main()
File "/home/brian/intellagent/simulator/visualization/pages/1_📈_Experiments_Report.py", line 253, in main
    st.dataframe(filtered_df)
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/streamlit/runtime/metrics_util.py", line 410, in wrapped_func
    result = non_optional_func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/streamlit/elements/arrow.py", line 547, in dataframe
    marshall_styler(proto, data, default_uuid)
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/streamlit/elements/lib/pandas_styler_utils.py", line 61, in marshall_styler
    styler._compute()
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/io/formats/style_render.py", line 256, in _compute
    r = func(self)(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/io/formats/style.py", line 2027, in _map
    result = self.data.loc[subset].map(func)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/frame.py", line 10468, in map
    return self.apply(infer).__finalize__(self, "map")
           ^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/frame.py", line 10374, in apply
    return op.apply().__finalize__(self, method="apply")
           ^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/apply.py", line 916, in apply
    return self.apply_standard()
           ^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/apply.py", line 1063, in apply_standard
    results, res_index = self.apply_series_generator()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/apply.py", line 1081, in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/frame.py", line 10466, in infer
    return x._map_values(func, na_action=na_action)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/base.py", line 921, in _map_values
    return algorithms.map_array(arr, mapper, na_action=na_action, convert=convert)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/intellagent/.env/lib/python3.12/site-packages/pandas/core/algorithms.py", line 1743, in map_array
    return lib.map_infer(values, mapper, convert=convert)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib.pyx", line 2972, in pandas._libs.lib.map_infer
File "/home/brian/intellagent/simulator/visualization/pages/1_📈_Experiments_Report.py", line 39, in _color_arrow
    return "color: green" if val > 0 else "color: red" if val < 0 else "color: black"
                             ^^^^^^^
```

![Image](https://github.com/user-attachments/assets/0e6c48d1-ddee-4536-9dcc-a17ed341a424)

Can you share the dump folder ('results')?
Since you run the template examples there is no personal information there. 

Certainly @Eladlev. Here you go: [https://drive.google.com/drive/folders/1P9AkZImXvFWYzIGFW_Ncxf4_0smytm9E?usp=drive_link](url)  -- I had to copy and paste the link into my browser for some reason.

After reviewing the logs, I see that you're experiencing a severe rate limit issue, leading to failures in 9 out of 10 requests. I'll fix the bug you're encountering, but you should either increase your TPM quota or reduce the number of workers to prevent this issue.

Aha! Thanks for the insight @Eladlev. 

The error was fixed, thanks for providing all the details

Thank you very much, @Eladlev. I am continuing testing with your framework and may have some more issues and PR's. I look forward to working on it.