I use the scikit-learn library to perform Ridge regression with weights on individual samples. This can be done: esimator.fit(X, y, sample_weight=some_array) . Intuitively, I expect that larger weights mean more importance for the corresponding sample.
However, I tested the method above in the following two-dimensional example:
from sklearn import linear_model import numpy import matplotlib.pyplot as plt
I run this code, and I run it again, doubling the weight of the first sample:
sample_weight = numpy.array([2,1, 1])
The resulting lines are removed from the sample with a large weight. This is contrary to intuition, since I expect that a sample with a large weight is of great importance.
Am I using the library incorrectly, or is it a mistake there?
source share