Avaiga / taipy-doc

Holds the documentation set for Taipy, not including the code documentation obviously.
https://docs.taipy.io/
Apache License 2.0
12 stars 14 forks source link

Documentation about gathering and displaying results of existing scenarios #917

Closed AlexandreSajus closed 4 months ago

AlexandreSajus commented 5 months ago

The Core tutorial is actually pretty good for teaching the basics: https://docs.taipy.io/en/latest/tutorials/fundamentals/2_scenario_management_overview/

The problem is as soon as you want something a bit out of the bounds of this tutorial, you're lost. We need more tutorials and demos on advanced core concepts. One of them is how do I gather and display the results of existing scenarios. A good example is in this app: https://github.com/Avaiga/demo-mlp-regularization image

How do I gather the accuracies of my scenarios and display them in a bar chart?

jrobinAV commented 5 months ago
  1. About gathering results. A scenario comparison feature allows the user to define comparison functions in scenario_configurations. https://docs.taipy.io/en/develop/manuals/core/config/scenario-config/#using-scenario-comparators Did you check that? There is also a tutorial for that: https://docs.taipy.io/en/develop/tutorials/scenario_management/6_scenario_comparison/

    That answers the question of how to gather results. Does it?

  2. About the display: The display part depends on the comparison results defined by the user, and you can use taipy GUI controls to display the result.

If you want more automation, like not having to define the comparison function, please be aware that we are currently working on designing a scenario_comparator visual element that would fit most of the use cases.

Can you check the two documentation link and close the ticket if it does answer it?

AlexandreSajus commented 5 months ago

When I was creating the app, I looked through the docs using the search bar. I saw the tutorial https://docs.taipy.io/en/develop/tutorials/scenario_management/6_scenario_comparison/ But it does not address what I need. I just need a:

existing_scenarios = tp.get_scenarios()
accuracies = [scenario.accuracy.read() for scenario in existing_scenarios]

Then I'll display the accuracies using a chart.

I could not find this within the doc. I don't understand the scenario comparison thing, it looks like a heavy tool for what it does and the tutorial does not show images or anything impressive

jrobinAV commented 5 months ago

I believe the scenario comparison is exactly made for what you need. I agree and confess this API is challenging to understand.

It consists of defining a custom function to provide to your scenario config, taking a list of data nodes as input, and computing the comparison output in the suitable format. Then, you can use standard taipy GUI controls to display the formatted data. Something like:

existing_scenarios = tp.get_scenarios()
accuracies = tp.compare_scenarios(existing_scenarios, data_node_config_id="accuracy")

chart_md = "<| {accuracies} | chart | ... |>"

The data variable would have the content/format of your choice defined by your custom function. You can use any GUI component to display it.

How would you make it clearer or easier to understand? What would you expect to be an ideal solution for comparing your scenarios?

AlexandreSajus commented 5 months ago

The example you show would be perfect:

existing_scenarios = tp.get_scenarios()
accuracies = tp.compare_scenarios(existing_scenarios, data_node_config_id="accuracy")

chart_md = "<| {accuracies} | chart | ... |>"

We would only need to change the scenario comparison tutorial to use this code on an actual use case with an image (like comparing accuracies of different models on a bar chart)