-3

(https://i.stack.imgur.com/d9uuV.png)

I am trying to transform my dataset which is a python data frame or dictionary into a bunch dtype.

expected result

scikit learn has ready to use dataset such as iris or digits and many more. I believe these datasets are in an hand-written digits dataset format. I would like to convert my dataset to the hand-written digits dataset format to generate a UMAP plot.

Any recommendations are much appreciated.

  • 3
    What are you expecting from us? The documentation shows you exactly what a "bunch" object has to contain. – Tim Roberts Aug 15 '23 at 18:16
  • it really isn't clear what you are asking. there is no "bunch dtype". – juanpa.arrivillaga Aug 15 '23 at 19:39
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 15 '23 at 20:10
  • I am writing to convert dictionary to bunch. My end goal is to generate a UMAP plot. I have a dataframe converted to a dict. The example here has load_digits. I am familiar that load is a function to load the "digits" scikit dataset. But is there a process to generate my dataset similar to the "digits" datatset which is of type sklearn.utils.Bunch. there are examples online using the scikit datasets but how can i change the format of my dataset similar to that of scikit datasets such as digits. – user22394410 Aug 15 '23 at 20:17
  • From the screenshot I understand what a bunch object should look like. But is the conversion done manually? I am using this link for UMAP plot - https://umap-learn.readthedocs.io/en/latest/transform.html. – user22394410 Aug 15 '23 at 20:17
  • @user22394410 a "bunch" isn't a *type* of object. It isn't a subclass of dict. It is just a dict with particular keys-value pairs. Yes, presumably, that API expects you to construct that dict *somehow*. Again, it really isn't clear what you are asking. Note, it seems like the "bunch" is the *return value* of that function. It owuld help if you actually gave us a concrete description of what you are trying to accomplish. Don't post screenshots. Give us the link to the documentation – juanpa.arrivillaga Aug 15 '23 at 20:29

0 Answers0