{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "7765UFHoyGx6" }, "source": [ "##### Copyright 2020 The TensorFlow Authors." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cellView": "form", "execution": { "iopub.execute_input": "2024-12-15T12:16:12.785579Z", "iopub.status.busy": "2024-12-15T12:16:12.785034Z", "iopub.status.idle": "2024-12-15T12:16:12.789199Z", "shell.execute_reply": "2024-12-15T12:16:12.788576Z" }, "id": "KsOkK8O69PyT" }, "outputs": [], "source": [ "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# https://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License." ] }, { "cell_type": "markdown", "metadata": { "id": "RKQpW0JqQQmY" }, "source": [ "# Shape Constraints with Tensorflow Lattice\n" ] }, { "cell_type": "markdown", "metadata": { "id": "r61fkA2i9Y3_" }, "source": [ "
\n",
" ![]() | \n",
" \n",
" ![]() | \n",
" \n",
" ![]() | \n",
" \n",
" ![]() | \n",
"
🌲 Try YDF, the successor of\n", " TensorFlow\n", " Decision Forests using the same algorithms but with more features and faster\n", " training!\n", "
\n", "\n", " Old code
\n", "\n", "import tensorflow_decision_forests as tfdf\n", "\n", "tf_ds = tfdf.keras.pd_dataframe_to_tf_dataset(ds, label=\"l\")\n", "model = tfdf.keras.RandomForestModel(label=\"l\")\n", "model.fit(tf_ds)\n", "\n", "
\n", " New code
\n", "\n", "import ydf\n", "\n", "model = ydf.RandomForestLearner(label=\"l\").train(ds)\n", "\n", "
(Learn more in the migration\n", " guide)
\n" ], "text/plain": [ "