Using Features of different dimensions in XGBoost Classifier

Hi XGB community,
I’m working on a classification problem with text, I have a high dimensional encoding of each sentence and a bunch of other categorical features as well. Is there a way I can use these features (of diff dimensions) together, given that the categorical features are well, unidimensional and the encoding vectors are 300-dimensional arrays each?

Things I’ve tried but throw errors: Creating a DMatrix using each feature as an array separately.
creating a pandas dataframe of all the features with each feature in a column.

When I try to create a DMatrix, or use the DataFrame directly, it throws me an error that :
“DataFrame.dtypes for data must be int, float, bool or category. When
categorical type is supplied, DMatrix parameter enable_categorical must
be set to True. Invalid columns:eng_embeddings”

where eng_embeddings is the column with 300-dimensional arrays, the type of this column in the dataframe is Object although when I print the type(df[‘eng_embedding’][0]) it is a numpy.ndarray

any help is appreciated, thanks!

Edit: also tried setting the enable_categorical parameter to true, didn’t work for me

XGBoost cannot handle a DataFrame column where each element itself is a list. Perhaps you can unpack the encoding vector into 300 separate columns?

@hcho3, thanks for the reply. i had this Idea as the last resort in my mind but wanted to check still if there was any way around it. Is it possible for me to create a DMatrix itself using arrays of different dimensions?

For eg:

embs of shape (N, 300), x1 of shape (N,1) and x2 of shape (N,1) ?

No, XGBoost expects a flat 2D table