Reputation: 13
This is related to linear regression analysis. When I add a column of ones for the intercept term in the design matrix, why do I have to assign a column of 1.0 instead of 1? (The ordinary least square solution using a column of 1.0 is different from using a column of 1)
Upvotes: 1
Views: 48
Reputation: 41
Probably type consistency: There are multiple numeric types, and all values in your matrix should have the same type. So, assuming that the rest of your matrix is not integers, your ones also can't be integers.
Edit: ref. kind of similar issue discussed here: Store different datatypes in one NumPy array?
Upvotes: 1