# Penalising input datapoints to a logistic regression

I am fitting a logistic regression model using 4 indepdendent features. These features are counts of signal features present in a time series dataset. For example, number of peaks, number of troughs, etc. We have approximately 100,000 samples, however these have been measured from signals of differing length (between 10 and 60 minutes). The most 'truly' representative data are from those samples acquired for 60 minutes, however many of the samples are from observations less than 20 minutes. Converting these signal feature counts to the frequency domain (e.g. 10 peaks per hour) results in an overestimation of certain features from the shorter signal duration samples because we know, for example, that 100 peaks per hour does not occur. The frequency of features within these signals are non-steady and change significantly throughout recording. Only once a recording duration of >40 minutes are the signal features most reliable.

Therefore, the question is: is there a way to 'penalise' the datapoints that are from shorter signal lengths (e.g. <30 minutes) in the model training process?

• I am not sure whether you are confused by your scaling. eg would 15 peaks/10 minutes be more meaningful? A tennis ball can be served at 263 km/h. That doesn't mean any tennis ball has ever travelled 263 kilometres from a serve. Dec 29, 2021 at 17:46

• Alternatively, you could include the inverse of measurement length as a sample weights in your model (e.g. weights parameter in R's glm, or sample_weight parameter of the fit method for logistic regression in Python's scikit-learn). This would force the model to pay more importance to longer measurements and less to shorter, proportionally to the length. This is a pretty standard approach. One problem with this solution is that you would need to decide how would like to penalize for measurement length: should the weight be proportional to the inverse of the length or maybe it should be some non-linear transformation..?