Say I am training a ridge regression model on nothing but binary variables. The context being that each variable represents a player - a value of 1 meaning they were playing the game at the time, value of 0 meaning they were not. The idea is to assess their value using the model coefficients
I want to give certain players more credit for the response variable than others, though, based on prior information (say a value representing their performance during that game - their rating). For one observation, I might have five teammates with a value of 1 but I don't want them to get equal credit for the result if I know one of them performed far better than another.
I tried multiplying the binary variable by the rating so that a value of 0 means that they were not playing in the game and any other value means they were, with a greater number meaning they performed better. However, this gave me super funky results (the method of not applying any weights at all performed far better). I'm wondering if that's because my method was invalid in some way? If so, what's a better way to do it?
Would like to do this in Python or R if possible