# LinearRegression with fixed slope parameter

I have some data $$(x_{1},y_{1}), (x_{2},y_{2}), ..., (x_{n},y_{n})$$, where both $$x$$ and $$y$$ represent real numbers (float). I want use Scikit-learns LinearRegression model to fit a model of the form:

$$y_{i} = b_{0} + b_{1}x_i + e_{i}$$

Typically, I know that OLS is used to compute the parameters $$b_{0}, b_{1}$$. However, in my case, I happen to know that $$b_{1}=c$$ so I only want to fit $$b_{0}$$. Is there a way to force scikit-learn to use $$b_{1}=c$$ as the slope ratio and only estimate the intecept $$b_0$$, or is a custom class necessary?

You can just compute: $$\hat{b}_0 = \operatorname{mean}(y-cx)$$