Training models inside Streamlit apps
Often, we may want to have the user input change how our model is trained. We may want to accept data from the user or ask the user what features they would like to use, or even allow the user to pick the type of ML algorithm that they would like to use. All of these options are feasible in Streamlit, and in this section, we will cover the basics of using user input to affect the training process. As we discussed in the section above, if a model is going to be trained only once, it is probably best to train the model outside of Streamlit and import the model into Streamlit. But what if, in our example, the penguin researchers have the data stored locally, or do not know how to retrain the model but have the data in the correct format already? In cases like these, we can add the st.file_uploader()
option and include a method for these users to input their own data, and get a custom model deployed for them without having to write any code. The following...