h2oai / h2o4gpu

H2Oai GPU Edition
Apache License 2.0
460 stars 95 forks source link

Elastic Net Regression in R #869

Open prateeksasan1 opened 3 years ago

prateeksasan1 commented 3 years ago

Hi,

I just downloaded the h2o4gpu package for R 4.0.2 and tried running the examples. While running the elastic net regression, i got the following error :

System Information :

R : 4.0.2 Cuda : 10.0.130 Python: 3.6 packageVersion(h2o4gpu): 0.3.2

Code :

train <- read.csv("https://s3.amazonaws.com/erin-data/higgs/higgs_train_10k.csv") test <- read.csv("https://s3.amazonaws.com/erin-data/higgs/higgs_test_5k.csv")

Create train & test sets (column 1 is the response)

x_train <- train[, -1] y_train <- train[, 1] x_test <- test[, -1] y_test <- test[, 1]

model_enc <- h2o4gpu.elastic_net_classifier() %>% fit(x_train, y_train)

Error :

Error in py_call_impl(callable, dots$args, dots$keywords) : ImportError: cannot import name 'signature'

Detailed traceback: File "/users/PAS1316/prateeksasan/venv/h2o4gpu/lib64/python3.6/site-packages/h2o4gpu/solvers/elastic_net.py", line 1607, in get_params return self.model.get_params() File "/users/PAS1316/prateeksasan/venv/h2o4gpu/lib64/python3.6/site-packages/h2o4gpu/solvers/elastic_net.py", line 1259, in get_params for key in self._get_param_names(): File "/users/PAS1316/prateeksasan/venv/h2o4gpu/lib64/python3.6/site-packages/h2o4gpu/solvers/elastic_net.py", line 1232, in _get_param_names from ..utils.fixes import signature

JBleher commented 3 years ago

You need to substitute line 1232 in elastic_net.py with from funcsigs import signature