I am using LinearRegression from sklearn.linear_model. Can I force the coefficients between 0 and 1? Also, can I give priority to solutions involving only binary coefficients? (Assume such a solution exists!)
From https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html, I only know how to force positive coefficients using the positive=True parameter, but coefficients reach values above 1:
from sklearn.linear_model import LinearRegression
reg = LinearRegression(positive=True, fit_intercept=False).fit(X, y)
Alternatively, can you suggest a different model for this?
EDIT:
As I understand, the command reg.coef_ shows the coefficients that were found to fit the data best. Can I force the algorithm to only look for solutions with coefficients in the range of 0-1 (or if possible binary)? E.g., scipy.optimize.curve_fit allows to set bounds (possible ranges) for each variable.