New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
display association rules plots in streamlit #901
Conversation
Hey @batmanscode, thanks for your contribution! I am not familiar with streamlit, but can it be applied to other plots too - for example, in regression or clustering? |
Hi @Yard1, yes absolutely! Adding a conditional I would like to add And as a side note, I do recommend checking out streamlit when you have the time 馃槂 |
Okay so maybe |
I think it would be a good idea to have a unified API. Do you think you could add that? If you have trouble with modifying |
Yeah I think you're right. Makes more sense to have it uniform. Yes, I should be able to! Thank you, I will let you know if I run into any problems 馃槂 |
included in plot_model() so it can pass display_format to ..internal.tabular.plot_model
included in plot_model() so it can pass display_format to ..internal.tabular.plot_model
included in plot_model() so it can pass display_format to ..internal.tabular.plot_model
included in plot_model() so it can pass display_format to ..internal.tabular.plot_model
added `display_format == 'streamlit'` for `fig.iplot()` had to change `asFigure = save_param` to `asFigure = True` this is needed because streamlit needs a plotly object to interpret (https://discuss.streamlit.io/t/cufflinks-in-streamlit/2232/2) for `fig.show()`, just added if `st.write(fig)`
Hi @Yard1, my last commit is failing some tests but I'm not sure why. Can you please have a look when you have some time? |
Btw, for plots like on this line: Why is it |
@batmanscode Apologies, I must have missed this. I'll take a look as soon as I am able. |
No problem at all @Yard1, I just figured you must have been busy. Alright, thank you 馃槂 |
@batmanscode Could you merge master into this branch, so the tests can pass? Thanks. |
merge master into this branch so tests can pass
@batmanscode So the issue was that |
Oh right, thank you for the fix and explanation 馃槂 will keep that in mind for any future changes. Okay sure, that does sound clearer. I will go through and add this exception. And I think you mean I do have a concern about naming the default plots: Or do you think that it's unlikely and For example: In this case, another option could be to change |
Fair point. Let's keep |
Alright will do. I think the if/else statements need to be changed as well. Right now things will work fine even if an invalid value is passed since it will just execute Right now it's:
But something like this is probably better:
|
@batmanscode It's fine to leave it as is, considering we'll have value checks beforehand. |
Ah yes, thanks! |
parameters that are checked: * model * plot * display_format
All done @Yard1. Sorry, forgot to comment that I was finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thing, please change this in all strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing - can you run black on all modified files? Thanks.
Done 馃憤馃徎 |
Thanks, looks great. |
@batmanscode Hey, are you on PyCaret slack? Could you join if you haven't already and DM me there? I have no experience with streamlit but would like to expand the support for it to yellowbrick visualizers and I could use your help. Thanks. |
Thank you @Yard1, I've learnt a lot doing this 馃槂 Sure, I can join and contact you there, happy to help. I actually haven't used slack in a few years lol. |
Hey! Does anyone knows a way to show evaluate_model results on streamlit? Thanksss |
Hi, You can create your own Something like this should work 馃槉:
|
issue #884
Changes
Added
display_format
Notes
import streamlit as st
since this will only work inside streamlit anywayst.plotly_chart
sincest.write
can plot many types of charts and won't have to be changed if plotly is dropped laterUpdate
display_format
to anywhereplot_model
can be called 馃槂Additional:
In nlp.py where
fig.iplot()
is used, I had to changeasFigure = save_param
toasFigure = True
because streamlit needs a plotly object to interpret (https://discuss.streamlit.io/t/cufflinks-in-streamlit/2232/2)