Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient boosting tutorial never actually touches X_train and y_train #185

Open
1 task done
mobiusklein opened this issue Jul 3, 2023 · 0 comments
Open
1 task done
Assignees

Comments

@mobiusklein
Copy link

mobiusklein commented Jul 3, 2023

Pre-issue creation checklist

  • No duplicates of this issue have already been created.

Name of the tutorial/dataset

NIST (part 2): Traditional ML: Gradient Boosting

Describe the mistake or typo

Gradient boosting tutorial never actually touches X_train and y_train

Additional context

Lines using X_test when context suggests it should be X_train

"outputs": [],
"source": [
"reg = GradientBoostingRegressor()\n",
"\n",
"X_train = train_val_encoded.drop(columns=[\"spectrum_id\", \"b_target\", \"y_target\"])\n",
"y_train = train_val_encoded[\"b_target\"]\n",
"X_test = test_encoded.drop(columns=[\"spectrum_id\", \"b_target\", \"y_target\"])\n",
"y_test = test_encoded[\"b_target\"]\n",
"\n",
"reg.fit(X_test, y_test)"
]

"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def objective(n_estimators):\n",
" # Define algorithm\n",
" reg = GradientBoostingRegressor(n_estimators=n_estimators)\n",
"\n",
" # Fit model\n",
" reg.fit(X_test, y_test)\n",

Also, this may be a failure in my reading/understanding the notebook, but the notebook says the model it trains can only predict y ions, but the training target is listed as b_target, not y_target (see line 407) in first snippet.

"And of course, this model can only predict y-ion intensities. You can repeat the\n",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants