# Is regression a good model for predicting disk usage growth? [closed]

I am struggling a bit with the logic.

I need to estimate growth based on historical data.

My data is basically composed of dates + a snapshot of disk usage.

date disk_usage growth
2001.01.01 520 NULL
2001.01.02 537 1.0327
2001.01.03 544 1.0130
2001.01.04 546 1.00367
2001.01.04 ... ...

I want to estimate the growth column to a point where I can use

disk_usage[T-1] * growth[T] = forecasted value

Data is pretty linear. So a linear model should do the job. When I do the regression in EXCEL the line looks pretty straight, not many outliers, no seasonality and the data looks stationary.

I need to do the regression in Python. When I use the statsmodel package I need to use a equation as a string :

import statsmodels.formula.api as smf

model = smf.ols('???', data=dt)


In the above, the ???, should it be growth ~ growth[T-1] or growth ~ rowIndex or maybe I should add another column which is days since the first date in the sample ?

UPDATE: I am not looking for anything too complex. Just a informed guess. This is not a critical component of our system and even if it is not 100% accurate, no one will suffer.

If you want to use regression, I recommend using the scikit-learn library. It's quite straightforward:

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html

import numpy as np
from sklearn.linear_model import LinearRegression
X = np.array(your_data_x)
Y = np.array(your_data_y)
model = LinearRegression().fit(X, Y)

prediction = model.predict(np.array(new_entry))
print(prediction)

• downvoted because it doesn't answer the question asked Sep 21 at 9:04
• "I need to do the regression in Python" " I am not looking for anything too complex" I provided you an answer which is simple and does regression. @user91991993 Sep 21 at 21:26
• I agree that the question asks for a Python solution and you address that. The difficulty is that this is not a site about how to do things in Python (or any other specific programming language).
– whuber
Sep 21 at 21:33