Dec-16-2020, 11:26 AM
Hello everybody. I'm running a script where I'm trying to predict with sklearn the values of a variable, called involvement (measured as a number from 1 to 6) from a variable called valence (number from -1 to 1). These values came from a questionnaire where some people rated a list of sentences (valence) or answered some personality questions (immersion).
I should obtain an array (51, 125) for my independent variable and an array (51, 1) for my dependent variable, but when I apply the numpy.array method to my list I only get one dimensional array.
To be clear I should get something like this:
I should obtain an array (51, 125) for my independent variable and an array (51, 1) for my dependent variable, but when I apply the numpy.array method to my list I only get one dimensional array.
To be clear I should get something like this:
train_valence (20, 125) [[1. 2. 4. ... 5. 5. 6.] [5. 3. 5. ... 4. 4. 6.] [5. 5. 4. ... 5. 6. 7.] ... [4. 4. 3. ... 4. 4. 4.] [6. 6. 7. ... 6. 7. 6.] [6. 2. 7. ... 4. 4. 5.]]but instead I get
train_valence (51,) [list([4.0, 2.0, 3.0, 2.0, 2.0, 4.0, 3.0, 4.0, 4.0, 3.0, 2.0, 4.0, 3.0, 4.0, 3.0, 3.0, 4.0, 2.0, 3.0, 3.0, 2.0, 2.0, 2.0, 1.0, 1.0, 4.0, 3.0, 5.0, 4.0, 4.0, 2.0, 3.0, 5.0, 4.0, 4.0, 3.0, 2.0, 4.0, 4.0, 3.0, 3.0, 3.0, 5.0, 3.0, 3.0, 2.0, 3.0, 2.0, 2.0, 3.0, 2.0, 3.0, 4.0, 2.0, 3.0, 3.0, 3.0, 2.0, 3.0, 3.0, 3.0, 4.0, 3.0, 3.0, 2.0, 3.0, 3.0, 4.0, 3.0, 3.0, 3.0, 2.0, 3.0, 4.0, 1.0, 3.0, 3.0, 3.0, 4.0, 4.0, 3.0, 4.0, 4.0, 3.0, 3.0, 2.0, 3.0, 3.0, 4.0, 4.0, 3.0, 4.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3.0, 4.0, 4.0, 3.0, 3.0, 3.0, 4.0, 3.0, 4.0, 3.0, 4.0, 3.0, 3.0, 4.0, 3.0, 4.0, 4.0, 2.0, 4.0, 3.0, 3.0, 4.0,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