\n",
+ "
\n",
"
\n",
"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " rental_price | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 2167.179067 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1881.860347 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2430.833594 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 5510.144792 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2272.339955 | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " 4126.598719 | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
+ " 2224.262202 | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " 2104.066761 | \n",
+ "
\n",
+ " \n",
+ " 8 | \n",
+ " 3860.835156 | \n",
+ "
\n",
+ " \n",
+ " 9 | \n",
+ " 2040.849091 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 18
+ }
+ ],
+ "source": [
+ "cursor.query(\"SELECT PredictHouseRent(*) FROM postgres_data.home_rentals LIMIT 10;\").df()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "bRuPU8hVc3nv"
+ },
+ "source": [
+ "We have the option to utilize a `LATERAL JOIN` to compare the actual rental prices in the `home_rentals` dataset with the predicted rental prices generated by the trained model, `PredictHouseRent`."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 352
+ },
+ "id": "1rDikEWodBdX",
+ "outputId": "39207488-3256-4423-d2e2-59ba56656aec"
+ },
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " rental_price predicted_rental_price\n",
+ "0 2167.000 2167.179067\n",
+ "1 1883.000 1883.452487\n",
+ "2 2431.000 2430.646094\n",
+ "3 5510.000 5509.533854\n",
+ "4 2272.000 2272.023586\n",
+ "5 4123.812 4123.744156\n",
+ "6 2224.000 2224.262202\n",
+ "7 2104.000 2103.969496\n",
+ "8 3861.000 3861.523438\n",
+ "9 2041.000 2040.849091"
+ ],
+ "text/html": [
+ "\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " rental_price | \n",
+ " predicted_rental_price | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 2167.000 | \n",
+ " 2167.179067 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1883.000 | \n",
+ " 1883.452487 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2431.000 | \n",
+ " 2430.646094 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 5510.000 | \n",
+ " 5509.533854 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2272.000 | \n",
+ " 2272.023586 | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " 4123.812 | \n",
+ " 4123.744156 | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
+ " 2224.000 | \n",
+ " 2224.262202 | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " 2104.000 | \n",
+ " 2103.969496 | \n",
+ "
\n",
+ " \n",
+ " 8 | \n",
+ " 3861.000 | \n",
+ " 3861.523438 | \n",
+ "
\n",
+ " \n",
+ " 9 | \n",
+ " 2041.000 | \n",
+ " 2040.849091 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 19
}
],
"source": [
@@ -2279,4 +3162,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
-}
+}
\ No newline at end of file