This comes from the case where you have multiple features (inputs) and one response variable (output). Then, the input X
is a matrix with number_of_features
columns and number_of_samples
rows, and the output y
is a column vector with number_of_samples
elements. Following the convention of naming matrices with uppercase letters and vectors with lowercase letters, which is widely used in mathematics and/or related fields, it makes sense that X
has to be uppercase and y
has to be lowercase.
If you only have one feature, so the input is a column vector and not a matrix, then x
should be lowercase. And if you have multiple response variables and the output is a matrix, then Y
should be uppercase.
Finally, using more descriptive names than X
and y
is always a good idea. Then, following the PEP 8 convention uf using snake_case for variable names - or whatever the style guide you are following recommends - is the way to go.