cannot import name 'Regressor' from 'gmdh'

126 Views Asked by At

I have installed gmdhpy through pip install git+git://github.com/kvoyager/GmdhPy.git

While trying to import from gmdhpy.gmdh import Regressor it gives error:

cannot import name 'Regressor' from 'gmdh' (C:\Users\HP\PycharmProjects\pythonProject\venv\lib\site-packages\gmdh_init_.py)

i am working in python using Pycharm in windows 10 environment.

I want to do time series forecasting through Group Method of Data Handling and i think Regressor library file would be good for it.

1

There are 1 best solutions below

0
mikhail-xnor On

Use this module:

pip install gmdh

(https://pypi.org/project/gmdh/)

Time series data preparations:

>>> X, y = gmdh.time_series_transformation([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], lags=3)
>>> x_train, x_test, y_train, y_test = gmdh.split_data(X, y)
>>> x_test
array([[ 7.,  8.,  9.],
       [ 8.,  9., 10.]])
>>> y_test
array([10., 11.])

Fitting the model and making predictions 5 steps ahead (lags=5) based only on the first row of x_test data:

>>> model = gmdh.Mia()
>>> y_pred = model.fit(x_train, y_train).predict(x_test[0], lags=5)
>>> y_pred
array([10., 11., 12., 13., 14.])

Module documentation:

https://bauman-team.github.io/GMDH/python/html/index.html