2020-12-22 21:25:37 +00:00
|
|
|
# ClearML - Example of Plotly integration and reporting
|
2020-06-13 21:01:30 +00:00
|
|
|
#
|
2020-12-22 21:25:37 +00:00
|
|
|
from clearml import Task
|
2020-06-13 21:01:30 +00:00
|
|
|
import plotly.express as px
|
|
|
|
|
|
|
|
|
2020-12-23 22:30:32 +00:00
|
|
|
# Connecting ClearML with the current process,
|
|
|
|
# from here on everything is logged automatically
|
2020-06-15 19:48:51 +00:00
|
|
|
task = Task.init('examples', 'plotly reporting')
|
2020-06-13 21:01:30 +00:00
|
|
|
|
2020-06-15 19:48:51 +00:00
|
|
|
print('reporting plotly figures')
|
|
|
|
|
|
|
|
# Iris dataset
|
2020-06-13 21:01:30 +00:00
|
|
|
df = px.data.iris()
|
2020-06-15 19:48:51 +00:00
|
|
|
|
|
|
|
# create complex plotly figure
|
2020-06-13 21:01:30 +00:00
|
|
|
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", marginal_y="rug", marginal_x="histogram")
|
|
|
|
|
2020-06-15 19:48:51 +00:00
|
|
|
# report the plotly figure
|
2020-06-13 21:01:30 +00:00
|
|
|
task.get_logger().report_plotly(title="iris", series="sepal", iteration=0, figure=fig)
|
|
|
|
|
|
|
|
print('done')
|