# How to interpret the learning curve of a LinearRegression for sparse data?

I have a dataset of shape ca.(4800, 350). Both the dataset X as well as the response y is very sparse (ca. 3500 samples with y=0). I wanted to take a look at the learning curve to estimate the bias-variance tradeoff but I have difficulties to interpret the results.

In my opinion the model mostly learns the y=0 response which then leads to a higher error if the samples with y!=0 are learned (these are the peaks). If that is the case can a over-sampling strategy (e.g. SMOTE) help?

EDIT: per commenter (@user2974951) request a histogram of y:

• My suggestion is to weight the y=0 points to both keep them in the regression and not strongly force the regression through those points. It is a good idea to find the number of distinct y values to determine if there are any similarly over-represented data points in the regression data. For example if 90 percent of the data points have a value of 0, I personally would use a weight of (1.0 - 0.9) for those points, that is, a weight of 0.1. – James Phillips Sep 12 '19 at 9:37
• @JamesPhillips Thank you for the recommendation. Can I just multiply my sample vector with their weight before feeding them into the estimator or how is a weighting scheme applied correctly? – the_man_in_black Sep 12 '19 at 11:15
• Can you show a plot of y? – user2974951 Sep 12 '19 at 13:38
• No you cannot directly multiply (sadly) and you would need software that allows weighted fitting. The same thing can be done by averaging the values where y = 0 into a single data point, and in this specific case that should be as effective as my weighting suggestion. – James Phillips Sep 12 '19 at 14:14
• @JamesPhillips scikit-learns LinearRegression does allow fitting with sample weights. I will try that out first. – the_man_in_black Sep 12 '19 at 14:49