# How to structure MultiDataSet for mixed data / multi-input model?

**URL:** <https://community.konduit.ai/t/how-to-structure-multidataset-for-mixed-data-multi-input-model/1542>\
**Category:** DL4J\
**Created:** [August 9, 2021, 5:04pm UTC](https://community.konduit.ai/t/how-to-structure-multidataset-for-mixed-data-multi-input-model/1542 "2021-08-09T17:04:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Alexander](https://community.konduit.ai/u/Alexander)\
**Post date:** [August 9, 2021, 5:04pm UTC](https://community.konduit.ai/t/how-to-structure-multidataset-for-mixed-data-multi-input-model/1542/1 "2021-08-09T17:04:41Z")

</div>

Hi all,

I need your help on how MultiDataSet must be structured to work with models similar to this one:  
 ![Multi-input](https://canada1.discourse-cdn.com/flex035/uploads/konduit/original/1X/f25d75d96141fcada5100f25bf305c88c4e3fb5c.jpeg)

That is each data instance would have 2 feature vectors of diffrent length and one label vector.

I tried the following approach, but I get java.lang.IllegalStateException: Ragged array detected:

```auto
public static final MultiDataSet TRAINING_DATA = new MultiDataSet(
            Nd4j.createFromArray(new Float[][][]{
                    {
                            {1f, 2f, 3f, 4f, 5f, 6f, 7f},
                            {9f, 8f, 1f, 1f, 3f, 4f, 5f},
                            {2f, 3f, 4f, 5f, 6f, 8f, 9f}
                    },
                    {
                            {1f, 2f, 3f, 4f},
                            {5f, 6f, 7f, 8f},
                            {9f, 1f, 3f, 4f}
                    }
            }),
            Nd4j.createFromArray(new Integer[][]{
                    {0, 0, 1},
                    {1, 0, 1},
                    {0, 1, 0}
            })
    );

```

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [August 9, 2021, 5:22pm UTC](https://community.konduit.ai/t/how-to-structure-multidataset-for-mixed-data-multi-input-model/1542/2 "2021-08-09T17:22:33Z")

</div>

You are using the MultiDataSet constructor with single features/labels input.

Instead you want to use the constructor with multiple inputs, i.e. the one that takes `INDArray[]` inputs.
