From 2c1586a40ef82c359d273ba04dc393698b0b9fc7 Mon Sep 17 00:00:00 2001 From: Adrian Hayler Date: Fri, 22 May 2026 10:34:39 +0200 Subject: [PATCH 1/2] Remove feature selection cell from TabPFN_Demo_Local notebook --- examples/notebooks/TabPFN_Demo_Local.ipynb | 50 ---------------------- 1 file changed, 50 deletions(-) diff --git a/examples/notebooks/TabPFN_Demo_Local.ipynb b/examples/notebooks/TabPFN_Demo_Local.ipynb index 404606614..c2b1a30b9 100644 --- a/examples/notebooks/TabPFN_Demo_Local.ipynb +++ b/examples/notebooks/TabPFN_Demo_Local.ipynb @@ -3177,56 +3177,6 @@ " plt.show()" ] }, - { - "cell_type": "markdown", - "metadata": { - "id": "PkphS4vSFNvg" - }, - "source": [ - "### Feature selection\n", - "\n", - "Feature selection is the process of selecting a subset of relevant features for use in model construction. It's useful for reducing model complexity, improving performance by removing noise, and decreasing training time. Here, we'll use Sequential Forward Selection (SFS), which starts with no features and iteratively adds the feature that most improves the model's performance.\n", - "\n", - "The goal is to see if we can create a simpler, faster model with fewer features without a significant drop in accuracy.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "GPJtNDLnFPPW" - }, - "outputs": [], - "source": [ - "from tabpfn_extensions import interpretability\n", - "\n", - "# Load data\n", - "data = load_breast_cancer()\n", - "X, y = data.data, data.target\n", - "feature_names = data.feature_names\n", - "\n", - "# Initialize model\n", - "clf = TabPFNClassifier(n_estimators=1)\n", - "\n", - "# Feature selection\n", - "sfs = interpretability.feature_selection.feature_selection(\n", - " estimator=clf,\n", - " X=X,\n", - " y=y,\n", - " n_features_to_select=4,\n", - " feature_names=feature_names,\n", - " cv=3,\n", - ")\n", - "\n", - "# Print selected features\n", - "selected_features = [\n", - " feature_names[i] for i in range(len(feature_names)) if sfs.get_support()[i]\n", - "]\n", - "print(\"\\nSelected features:\")\n", - "for feature in selected_features:\n", - " print(f\"- {feature}\")" - ] - }, { "cell_type": "markdown", "metadata": { From f02bb064587fc998fadf8b5a49063ff23cac1153 Mon Sep 17 00:00:00 2001 From: Adrian Hayler Date: Fri, 22 May 2026 10:36:55 +0200 Subject: [PATCH 2/2] Add changelog entry --- changelog/978.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/978.changed.md diff --git a/changelog/978.changed.md b/changelog/978.changed.md new file mode 100644 index 000000000..b2ede5206 --- /dev/null +++ b/changelog/978.changed.md @@ -0,0 +1 @@ +Remove the feature selection cell from the TabPFN_Demo_Local example notebook.