Closed joshwigginton closed 1 year ago
Thank you for your notice! This tutorial 9 was uploaded 2 months ago, but OpenFE (https://github.com/IIIS-Li-Group/OpenFE) recently updated some of the documentation and code design. We have now changed the syntax to the latest version.
The following error could be specific to my environment but having issues with ofe = openfe()
Running the following code:
n_jobs=4 ofe = openfe() ofe.fit(data=X, label=Y, n_jobs=n_jobs) train_x, valid_x = transform(train_x, valid_x, ofe.new_features_list[:10], n_jobs=n_jobs) X, test_x = transform(X, test_x, ofe.new_features_list[:10], n_jobs=n_jobs)
**Gives this error:
TypeError Traceback (most recent call last) Cell In[5], line 179 176 Y = pd.DataFrame({"close": list(df_train['close'][1:])}) 178 n_jobs=4 --> 179 ofe = openfe() 180 ofe.fit(data=X, label=Y, n_jobs=n_jobs) 181 train_x, valid_x = transform(train_x, valid_x, ofe.new_features_list[:10], n_jobs=n_jobs)
TypeError: 'module' object is not callable
Change the import and code resolved the issue for me:
from openfe import OpenFE, transform
n_jobs=4 ofe = OpenFE() ofe.fit(data=X, label=Y, n_jobs=n_jobs) train_x, valid_x = transform(train_x, valid_x, ofe.new_features_list[:10], n_jobs=n_jobs) X, test_x = transform(X, test_x, ofe.new_features_list[:10], n_jobs=n_jobs)