strange array size problem

Robert Kern robert.kern at gmail.com
Fri Oct 18 11:37:14 EDT 2013


On 2013-10-18 16:25, chip9munk at gmail.com wrote:
> Hello everybody!
>
> One strange problem, please help!
>
> I have the following 2D array: users_elements_matrix
> numpy.shape(users_elements_matrix) is (100,43)
>
> and array merged_binary_ratings
> numpy.shape(merged_binary_ratings) is (100,)
>
> Now,when I run:
> numpy.linalg.lstsq(users_elements_matrix, merged_binary_ratings)
> i get some ridiculous numbers for coeficients, all are the same and 1.38946385e+15.
>
> What is really strange is that if I run
> numpy.shape(users_elements_matrix[:,0:42])
> i get ok numbers.
>
> I tested several thing and have examined the matrix, everything is ok with the data.
>
> how is it possible that one additional row (variable in linear regression)
> has such a strange impact?!!?
>
> I am loosing my mind here, please help!

The numpy-discussion mailing list is probably the best place to ask. I recommend 
posting a complete working example (with data) that demonstrates the problem. 
Use pastebin.com or a similar service if necessary.

   http://www.scipy.org/scipylib/mailing-lists.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list