Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi. When Using The Logger'S

Hi. When using the logger's report_histogram method, is there a way to "transpose" the displayed histogram so the bars will be on the y axis and the values on the x axis? The use case is when there are a lot of bars , for example for showing feature importance where each bar correspond to a feature.
I don't want to use "custom" image because when comparing two experiment i want to see the comparison in the same graph.
Is there any other way or best practice for showing feature importance information in an experiment?

  
  
Posted one year ago
Votes Newest

Answers 8


hi DistressedGoat23
can you send me an example of you report your histogram ?
i managed to transpose a histogram using something like this :

` t = Task.init(project_name=project_name, task_name=task_name)

df = px.data.tips()
figV = px.histogram(df, x="total_bill", y="tip", orientation='v')
figH = px.histogram(df, x="total_bill", y="tip", orientation='h')

log = t.get_logger()

log.report_plotly(
title='Histo',
series='plotlyH',
iteration=0,
figure=figH)

log.report_plotly(
title='Histo',
series='plotlyV',
iteration=0,
figure=figV) `
Could it work for your purpose ?

  
  
Posted one year ago

AgitatedDove14 Your suggestion is probably what I wanted, however it does not seem to change the orientation.
I tried adding extra_layout={"orientation":'h'}
as the last parameter to the report_histogram but I still see the "vertical" (default) orientation. Should I pass some other parameter value to extra_layout or should i report a bug?

  
  
Posted one year ago

SweetBadger76 Thanks for your detailed response. I was able to receive the graph with the layout i wanted (the left image you sent). However the problem with this approach is that when comparing two experiments it will show me two separate graph which makes it harder to compare individual bars.

  
  
Posted one year ago

Hmm let me check, because I think it should have worked

  
  
Posted one year ago

AgitatedDove14 Thanks for you help. I've opened an issue.
SweetBadger76 Thanks for your elaborate example. Its very helpful!

  
  
Posted one year ago

In the meantime, it is also possible to create a figure that will contain +2 histo and then report it to the logger using report_plotly.
You can have a look there :
https://plotly.com/python/histograms/#overlaid-histogram
https://plotly.com/python/histograms/#stacked-histograms

` log = task.get_logger()

x0 = np.random.randn(1500)
x1 = np.random.randn(1500) - 1

fig = go.Figure()

fig.add_trace(go.Histogram(y=x0))
fig.add_trace(go.Histogram(y=x1))

fig.update_layout(barmode='overlay') # 'stack'
fig.update_traces(opacity=0.75)
log.report_plotly(
title='Overlaid Histo (T)',
series='plotly (T)',
iteration=0,
figure=fig
) `

  
  
Posted one year ago

DistressedGoat23 you are correct, since at the end this become a plotly object the extra_layout is for general purpose layout, but this specific entry is next to the data. Bottom line, can you open a github issue, so we do not forget to fix? In the mean time you can use the general plotly reporting as SweetBadger76 suggested

  
  
Posted one year ago

DistressedGoat23 notice the last argument in report_histogram, 'extra_layout'
https://clear.ml/docs/latest/docs/references/sdk/logger#report_histogram
You can then specify the plotly histogram orientation, full details here:
https://plotly.com/javascript/reference/bar/
I'm assuming the one you are after is 'orientation '
https://plotly.com/javascript/reference/bar/#bar-orientation

  
  
Posted one year ago
457 Views
8 Answers
one year ago
one year ago
Tags