Skip to content
Advertisement

I have a data type problem in the text classification problem

I want to build deep learning classifiers for Kickstarter campaign prediction. I have a problem with the part of the model but I can not solve this.

My code:

JavaScript

In this point, I am getting ValueError: Failed to find data adapter that can handle input: <class ‘scipy.sparse.csr.csr_matrix’>, (<class ‘list’> containing values of types {“<class ‘str’>”})

I try np.asarray for solving

JavaScript

I get this ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type csr_matrix).

Therefore, I use this:

JavaScript

But I get ValueError: setting an array element with a sequence.

I try this:

JavaScript

But I keep getting the same error in the part of history. ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type csr_matrix).

I study with Kickstarter Campaigns Dataset at the Kaggle. https://www.kaggle.com/sripaadsrinivasan/kickstarter-campaigns-dataset

I don’t have enough NLP information. I search and try solvings but I can not solve. This is my homework. Can you help me for this problem?

df_X and df_y are equal sizes and their output is as follows: x y

Advertisement

Answer

you need to add an embedding layer at the top of your NN to kind of vectorize words. something like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement