Multiselect widget is a little weird

I want to select features for my machine learning model, about 300 features after I selected, the display in the widget is a little weird showed in the picture below. there are two main drawbacks

  1. I can only select feature one by one (if I select one feature, then the list will be shrunk, I need to click again and select the reset features)
  2. the display is so long

Could it be performed like picture beblow, I think it’s more user-friendly

The multi selection box is cumbersome when selecting many items, it is ideal for few items only. If your items can be grouped according to any attributes, you may include additional widgets to make a pre-selection. Lets say you have a list of 100 students and the attribute sex, grade, nationality you would have to include the following select boxes: sex, class, grade, nationality, student
Then, I would proceed as follows:
add a multi-selection list filled with the attributes you want to filter with (sex, class… + student)
for every item that is selected in the first select box, an additional select box that allows to narrow the list of students to be shown in a list. e.g. you select sex in the first list and female in the first filter list,
then your list of students will include all girls, you will not have to select them at all. if you want to exclude some of the girls, you can select the filter fields sex and student and again select the gender-filter ‘female’ the student filter will be filled with all girls and you may remove the ones that you want to exclude. alternatively you can add ‘add all’ and ‘remove all’ buttons to fill the students list based on the set filter and fill the students select box. In any case by using various linked controls, you can created fairly powerful filters. its a bit tedious, but the user will thank you if he does not have to pick hundreds of features from a list. hope that helps

that’s good for some data analysis task, but if you need train a machine learning model, there are hundreds features you need to select, and their priority are the same, you can not narrow down selection by giving multi-select box :sweat:,I can give a drop features selection box for user, and it can somewhat solve this problem, but it’s not a perfect way to do this.

Hi @kun,
thanks for your question. Yes, the multiselect widget is not designed for very long lists. I wonder we could come up with a different widget for these kind of uses cases. Still, as mentioned above, you may bale to categorize and split the features among multiple multiselect boxes as suggested by @godot63.

Feel free to file a Feature Request: https://github.com/streamlit/streamlit/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=

Matteo

thanks