I am trying to run a XGBoost model on the qm9 dataset, but I run into a “UnboundLocalError: local variable ‘nb_epoch’ referenced before assignment”. The other error that I have run into is there is a 1 missing positional argument with model.
I am trying to run a linear regression.
import deepchem as dc
from deepchem.molnet import load_qm9
tasks, datasets, transformers = dc.molnet.load_qm9(featurizer= dc.feat.CoulombMatrixEig(max_atoms=50))
train_dataset, valid_dataset, test_dataset = datasets
metric = dc.metrics.Metric(dc.metrics.mae_score)
train_scores, valid_scores, test_scores = benchmark_regression(train_dataset = train_dataset, valid_dataset = valid_dataset, test_dataset = test_dataset, tasks = tasks, transformers = transformers, n_features = 2, metric = metric, model = "xgb_regression")
For reference, I am using the benchmark regression found here: https://github.com/deepchem/deepchem/blob/2313f885cb86a87167e99b875d706abdc6526c35/deepchem/molnet/run_benchmark_models.py#L346
I am using a jupyter notebook, and had ran the benchmark_regression function code in a separate cell. For the function code, I replaced
import xgboost xgboost_model = xgboost.XGBRegressor( with
from deepchem.models.gbdt_models.gbdt_model import GBDTModel xgboost_model = GBDTModel( due to a prior deprecation in line 736.
On a side note, what would be the correct number of features?