<jupyter_start><jupyter_text>Tune Visualization In order to visualize results, please install `plotly` with the following command:  `pip install plotly`<jupyter_code>import os
import pandas as pd
from ray.tune.visual_utils import load_results_to_df, generate_plotly_dim_dict
import plotly
import plotly.graph_objs as go
plotly.offline.init_notebook_mode(connected=True)<jupyter_output><empty_output><jupyter_text>Specify the directory where all your results are in the variable `RESULTS_DIR`.<jupyter_code>RESULTS_DIR = os.path.expanduser("~/ray_results")
df = load_results_to_df(RESULTS_DIR)
[key for key in df]<jupyter_output><empty_output><jupyter_text>Choose the fields you wish to visualize over in `GOOD_FIELDS`.<jupyter_code>GOOD_FIELDS = ['experiment_id',
               'num_sgd_iter',
               'episode_len_mean',
               'episode_reward_mean']

visualization_df = df[GOOD_FIELDS]
visualization_df = visualization_df.dropna()
visualization_df<jupyter_output><empty_output><jupyter_text>Enjoy.Documentation for this Plotly visualization can be found here: https://plot.ly/python/parallel-coordinates-plot/<jupyter_code>data = [go.Parcoords(
            line = dict(color = 'blue'),
            dimensions = [generate_plotly_dim_dict(visualization_df, field) 
                              for field in visualization_df])
]

plotly.offline.iplot(data)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0884450784593438, 'fraction_numerical': 0.0, 'mean_word_length': 5.1535087719298245, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '292186', 'license': 'Apache-2.0', 'n_tokens_mistral': 478, 'n_tokens_neox': 455, 'n_words': 92, 'path': 'python/ray/tune/ParallelCoordinatesVisualization.ipynb', 'repo_name': 'bmorier/ray', 'size': '1402'}