{
"cells": [
{
"cell_type": "markdown",
"id": "f3f45407-987d-4d79-9650-2b67f875cc4a",
"metadata": {},
"source": [
"# Dzień 7"
]
},
{
"cell_type": "markdown",
"id": "84f23b82-ae45-46bd-a10b-019f7695a1db",
"metadata": {},
"source": [
"# forecasting"
]
},
{
"cell_type": "markdown",
"id": "5d2c3c47-4772-4114-ad39-6d4ad0026a99",
"metadata": {},
"source": [
"## Solar"
]
},
{
"cell_type": "markdown",
"id": "c5bec457-55e9-4113-98c4-4c66bf0c6d40",
"metadata": {},
"source": [
"### Biblioteki "
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "0de8e17c-93ee-4b39-ad7c-cf688e838182",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import tensorflow as tf\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"id": "fb9246bc-a45c-4c8c-b156-038fce834f91",
"metadata": {},
"source": [
"### Wczytanie danych"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "bc48fb44-a144-40e4-a879-37d73a49c9d1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Datetime\n",
"2007-10-01 00:00:00 0.0\n",
"2007-10-01 01:00:00 0.0\n",
"2007-10-01 02:00:00 0.0\n",
"2007-10-01 03:00:00 0.0\n",
"2007-10-01 04:00:00 0.0\n",
"Name: Incoming Solar, dtype: float64"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"series = pd.read_csv(\"time_series_solar.csv\", parse_dates=['Datetime'], index_col=\"Datetime\")[\"Incoming Solar\"]\n",
"\n",
"series.head()"
]
},
{
"cell_type": "markdown",
"id": "9b7f3349-eb5a-460b-bc9d-92041da86fbc",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"### ARIMA"
]
},
{
"cell_type": "markdown",
"id": "3009aaeb-f2dc-4baf-8729-a5311cacb2d9",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"#### Tworzenie i uczenie"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "ba96714b-41b5-4114-9d8f-d5b0717125da",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/sasza/.local/share/virtualenvs/JupyterLab-9JRWupKp/lib/python3.12/site-packages/statsmodels/tsa/base/tsa_model.py:473: ValueWarning: No frequency information was provided, so inferred frequency h will be used.\n",
" self._init_dates(dates, freq)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" SARIMAX Results \n",
"==============================================================================\n",
"Dep. Variable: Incoming Solar No. Observations: 52608\n",
"Model: ARIMA(3, 1, 1) Log Likelihood -311811.362\n",
"Date: Wed, 21 May 2025 AIC 623632.724\n",
"Time: 09:56:19 BIC 623677.077\n",
"Sample: 10-01-2007 HQIC 623646.585\n",
" - 09-30-2013 \n",
"Covariance Type: opg \n",
"==============================================================================\n",
" coef std err z P>|z| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"ar.L1 1.2602 0.002 512.194 0.000 1.255 1.265\n",
"ar.L2 -0.2351 0.004 -65.863 0.000 -0.242 -0.228\n",
"ar.L3 -0.2033 0.003 -75.840 0.000 -0.209 -0.198\n",
"ma.L1 -0.9970 0.000 -2652.955 0.000 -0.998 -0.996\n",
"sigma2 8237.1776 24.360 338.144 0.000 8189.433 8284.922\n",
"===================================================================================\n",
"Ljung-Box (L1) (Q): 33.68 Jarque-Bera (JB): 187848.52\n",
"Prob(Q): 0.00 Prob(JB): 0.00\n",
"Heteroskedasticity (H): 1.04 Skew: 0.51\n",
"Prob(H) (two-sided): 0.01 Kurtosis: 12.20\n",
"===================================================================================\n",
"\n",
"Warnings:\n",
"[1] Covariance matrix calculated using the outer product of gradients (complex-step).\n"
]
}
],
"source": [
"from statsmodels.tsa.arima.model import ARIMA\n",
"\n",
"model = ARIMA(series, order=(3, 1, 1), freq='h')\n",
"model_fit = model.fit()\n",
"print(model_fit.summary())"
]
},
{
"cell_type": "markdown",
"id": "eb1af070-d18d-4e01-8886-b42e1368ac30",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"#### Test"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "a09b2c6f-98d6-43bb-be39-0f39694a430f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/sasza/.local/share/virtualenvs/JupyterLab-9JRWupKp/lib/python3.12/site-packages/statsmodels/tsa/statespace/representation.py:374: FutureWarning: Unknown keyword arguments: dict_keys(['typ']).Passing unknown keyword arguments will raise a TypeError beginning in version 0.15.\n",
" warnings.warn(msg, FutureWarning)\n"
]
},
{
"data": {
"text/plain": [
"2013-10-01 00:00:00 24.388517\n",
"2013-10-01 01:00:00 55.123963\n",
"2013-10-01 02:00:00 88.124071\n",
"2013-10-01 03:00:00 117.527535\n",
"2013-10-01 04:00:00 140.575513\n",
"2013-10-01 05:00:00 155.999219\n",
"2013-10-01 06:00:00 164.039971\n",
"2013-10-01 07:00:00 165.861096\n",
"2013-10-01 08:00:00 163.129890\n",
"2013-10-01 09:00:00 157.624974\n",
"2013-10-01 10:00:00 150.959328\n",
"2013-10-01 11:00:00 144.408545\n",
"2013-10-01 12:00:00 138.839343\n",
"2013-10-01 13:00:00 134.716152\n",
"2013-10-01 14:00:00 132.161153\n",
"2013-10-01 15:00:00 131.042918\n",
"2013-10-01 16:00:00 131.072666\n",
"2013-10-01 17:00:00 131.892522\n",
"2013-10-01 18:00:00 133.146095\n",
"2013-10-01 19:00:00 134.527095\n",
"2013-10-01 20:00:00 135.806076\n",
"2013-10-01 21:00:00 136.838350\n",
"2013-10-01 22:00:00 137.557791\n",
"2013-10-01 23:00:00 137.961733\n",
"2013-10-02 00:00:00 138.091778\n",
"2013-10-02 01:00:00 138.014425\n",
"2013-10-02 02:00:00 137.804240\n",
"2013-10-02 03:00:00 137.531104\n",
"2013-10-02 04:00:00 137.252029\n",
"2013-10-02 05:00:00 137.007278\n",
"2013-10-02 06:00:00 136.819976\n",
"2013-10-02 07:00:00 136.698214\n",
"2013-10-02 08:00:00 136.638560\n",
"2013-10-02 09:00:00 136.630090\n",
"2013-10-02 10:00:00 136.658197\n",
"2013-10-02 11:00:00 136.707738\n",
"2013-10-02 12:00:00 136.765285\n",
"2013-10-02 13:00:00 136.820447\n",
"2013-10-02 14:00:00 136.866362\n",
"2013-10-02 15:00:00 136.899556\n",
"2013-10-02 16:00:00 136.919380\n",
"2013-10-02 17:00:00 136.927223\n",
"2013-10-02 18:00:00 136.925697\n",
"2013-10-02 19:00:00 136.917900\n",
"2013-10-02 20:00:00 136.906839\n",
"2013-10-02 21:00:00 136.895041\n",
"2013-10-02 22:00:00 136.884360\n",
"2013-10-02 23:00:00 136.875921\n",
"2013-10-03 00:00:00 136.870197\n",
"2013-10-03 01:00:00 136.867138\n",
"2013-10-03 02:00:00 136.866344\n",
"Freq: h, Name: predicted_mean, dtype: float64"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pred = model_fit.predict(start=len(series),end=len(series)+50, typ=\"levels\")\n",
"pred"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4add26f7-0995-4a06-a495-3d71339827bc",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "f4048b90-85a9-4ca8-b9c9-675a65c66a94",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"### LSTM"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "9d306814-eedc-499c-8ab2-adda96a69b77",
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
"import torch.nn as nn\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.preprocessing import MinMaxScaler"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "b5e5d70e-9cb9-4cd8-9951-6896adaa05db",
"metadata": {},
"outputs": [],
"source": [
"def series_to_supervised(data, n_in=1, n_out=1, dropnan=True):\n",
" n_vars = 1 if len(data.shape) == 1 else data.shape[1]\n",
" df = pd.DataFrame(data)\n",
" cols, names = list(), list()\n",
" # input sequence (t-n, ... t-1)\n",
" for i in range(n_in, 0, -1):\n",
" cols.append(df.shift(i))\n",
" names += [(\"var%d(t-%d)\" % (j + 1, i)) for j in range(n_vars)]\n",
" # forecast sequence (t, t+1, ... t+n)\n",
" for i in range(0, n_out):\n",
" cols.append(df.shift(-i))\n",
" if i == 0:\n",
" names += [(\"var%d(t)\" % (j + 1)) for j in range(n_vars)]\n",
" else:\n",
" names += [(\"var%d(t+%d)\" % (j + 1, i)) for j in range(n_vars)]\n",
" # put it all together\n",
" agg = pd.concat(cols, axis=1)\n",
" agg.columns = names\n",
" # drop rows with NaN values\n",
" if dropnan:\n",
" agg.dropna(inplace=True)\n",
" return agg"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "3dc00ddd-6107-41a1-8de0-c777e5b1f555",
"metadata": {},
"outputs": [],
"source": [
"data = series_to_supervised(series, n_in=1, n_out=1)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "ae53c621-39ec-4251-be6f-df746a7dffa4",
"metadata": {},
"outputs": [],
"source": [
"series = series.resample('D').sum()"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "053c8a96-c055-4caa-9f58-6a49ac1fafd8",
"metadata": {},
"outputs": [],
"source": [
"scaler = MinMaxScaler(feature_range=(-1, 1))\n",
"train,test = train_test_split(data, test_size=0.2, shuffle=False)\n",
"train = scaler.fit_transform(train)\n",
"test = scaler.transform(test)\n"
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "7ca18f24-8faf-4675-8205-986940a77ff7",
"metadata": {},
"outputs": [],
"source": [
"X_train, y_train = train[:, :-1], train[:, -1]\n",
"X_test, y_test = test[:, :-1], test[:, -1]\n",
"\n",
"X_train = torch.from_numpy(X_train).type(torch.Tensor)\n",
"X_test = torch.from_numpy(X_test).type(torch.Tensor)\n",
"y_train = torch.from_numpy(y_train).type(torch.Tensor).view(-1)\n",
"y_test = torch.from_numpy(y_test).type(torch.Tensor).view(-1)\n",
"\n",
"X_train = X_train.view([X_train.shape[0], X_train.shape[1], 1])\n",
"X_test = X_test.view([X_test.shape[0], X_test.shape[1], 1])"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "34dcd6c9-ffa2-4d5e-8ae7-65619f490156",
"metadata": {},
"outputs": [],
"source": [
"class LSTM(nn.Module):\n",
" def __init__(self, input_dim, hidden_dim, num_layers, output_dim):\n",
" super(LSTM, self).__init__()\n",
" self.hidden_dim = hidden_dim\n",
" self.num_layers = num_layers\n",
" self.lstm = nn.LSTM(input_dim, hidden_dim, num_layers, batch_first=True)\n",
" self.fc = nn.Linear(hidden_dim, output_dim)\n",
"\n",
" def forward(self, x):\n",
" h0 = torch.zeros(self.num_layers, x.size(0), self.hidden_dim).requires_grad_()\n",
" c0 = torch.zeros(self.num_layers, x.size(0), self.hidden_dim).requires_grad_()\n",
" out, (hn, cn) = self.lstm(x, (h0.detach(), c0.detach()))\n",
" out = self.fc(out[:, -1, :])\n",
"\n",
" return out"
]
},
{
"cell_type": "code",
"execution_count": 52,
"id": "c73a7f15-bd10-460f-b317-813b217460ff",
"metadata": {},
"outputs": [],
"source": [
"model = LSTM(input_dim=1,\n",
" hidden_dim=32,\n",
" output_dim=1,\n",
" num_layers=1)"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "ae9959b1-39dc-4088-92fb-d8860e65238c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 0, Loss: 0.7092826962471008\n",
"Epoch: 10, Loss: 0.6484428644180298\n",
"Epoch: 20, Loss: 0.5884607434272766\n",
"Epoch: 30, Loss: 0.5275981426239014\n",
"Epoch: 40, Loss: 0.46536171436309814\n",
"Epoch: 50, Loss: 0.4024186432361603\n",
"Epoch: 60, Loss: 0.34060969948768616\n",
"Epoch: 70, Loss: 0.2827403247356415\n",
"Epoch: 80, Loss: 0.23206999897956848\n",
"Epoch: 90, Loss: 0.19147342443466187\n",
"Epoch: 100, Loss: 0.16242049634456635\n",
"Epoch: 110, Loss: 0.1442137509584427\n",
"Epoch: 120, Loss: 0.1341131627559662\n",
"Epoch: 130, Loss: 0.1285659521818161\n",
"Epoch: 140, Loss: 0.12475237250328064\n",
"Epoch: 150, Loss: 0.12126223742961884\n",
"Epoch: 160, Loss: 0.11771411448717117\n",
"Epoch: 170, Loss: 0.11410810053348541\n",
"Epoch: 180, Loss: 0.11048132181167603\n",
"Epoch: 190, Loss: 0.10684189945459366\n",
"Test Loss: 0.11549811065196991\n"
]
}
],
"source": [
"loss_fn = nn.MSELoss()\n",
"optimizer = torch.optim.Adam(model.parameters(), lr=0.001)\n",
"\n",
"epochs = 200\n",
"\n",
"for epoch in range(epochs):\n",
" model.train()\n",
" optimizer.zero_grad()\n",
"\n",
" out = model(X_train).reshape(-1, )\n",
" loss = loss_fn(out, y_train)\n",
" loss.backward()\n",
" optimizer.step()\n",
"\n",
" if epoch % 10 == 0:\n",
" print(f\"Epoch: {epoch}, Loss: {loss.item()}\")\n",
"\n",
"model.eval()\n",
"y_pred = model(X_test).reshape(-1, )\n",
"test_loss = loss_fn(y_pred, y_test)\n",
"print(f\"Test Loss: {test_loss.item()}\")"
]
},
{
"cell_type": "markdown",
"id": "f4989fd8-9578-4d77-92f0-1fd26e206359",
"metadata": {},
"source": [
"# Biblioteka H2O"
]
},
{
"cell_type": "markdown",
"id": "89675f04-66e9-4430-8b6c-338214129a81",
"metadata": {},
"source": [
"## AutoML"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "aa49b185-819d-453a-b19d-d9f353590a94",
"metadata": {},
"outputs": [],
"source": [
"import h2o\n",
"from h2o.automl import H2OAutoML\n",
"from h2o.frame import H2OFrame"
]
},
{
"cell_type": "markdown",
"id": "71c96630-ae51-4f8a-9991-8111918c635d",
"metadata": {},
"source": [
"### Wczytaj dane"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "28642ede-36a4-4c89-b4e8-0b7ac9ef432b",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" sepal_length | \n",
" sepal_width | \n",
" petal_length | \n",
" petal_width | \n",
" species | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 5.1 | \n",
" 3.5 | \n",
" 1.4 | \n",
" 0.2 | \n",
" setosa | \n",
"
\n",
" \n",
" | 1 | \n",
" 4.9 | \n",
" 3.0 | \n",
" 1.4 | \n",
" 0.2 | \n",
" setosa | \n",
"
\n",
" \n",
" | 2 | \n",
" 4.7 | \n",
" 3.2 | \n",
" 1.3 | \n",
" 0.2 | \n",
" setosa | \n",
"
\n",
" \n",
" | 3 | \n",
" 4.6 | \n",
" 3.1 | \n",
" 1.5 | \n",
" 0.2 | \n",
" setosa | \n",
"
\n",
" \n",
" | 4 | \n",
" 5.0 | \n",
" 3.6 | \n",
" 1.4 | \n",
" 0.2 | \n",
" setosa | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" sepal_length sepal_width petal_length petal_width species\n",
"0 5.1 3.5 1.4 0.2 setosa\n",
"1 4.9 3.0 1.4 0.2 setosa\n",
"2 4.7 3.2 1.3 0.2 setosa\n",
"3 4.6 3.1 1.5 0.2 setosa\n",
"4 5.0 3.6 1.4 0.2 setosa"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"data = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')\n",
"data.head()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "de1467ab-a6a1-432c-b581-7f0943de5114",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Checking whether there is an H2O instance running at http://localhost:54321..... not found.\n",
"Attempting to start a local H2O server...\n",
" Java Version: openjdk version \"24.0.1\" 2025-04-15; OpenJDK Runtime Environment (build 24.0.1); OpenJDK 64-Bit Server VM (build 24.0.1, mixed mode, sharing)\n",
" Starting server from /home/sasza/.local/share/virtualenvs/JupyterLab-9JRWupKp/lib/python3.12/site-packages/h2o/backend/bin/h2o.jar\n",
" Ice root: /tmp/tmpa7tg0tyr\n",
" JVM stdout: /tmp/tmpa7tg0tyr/h2o_sasza_started_from_python.out\n",
" JVM stderr: /tmp/tmpa7tg0tyr/h2o_sasza_started_from_python.err\n",
" Server is running at http://127.0.0.1:54321\n",
"Connecting to H2O server at http://127.0.0.1:54321 ... successful.\n"
]
},
{
"data": {
"text/html": [
"\n",
" \n",
"\n",
"
\n",
" \n",
" \n",
" | H2O_cluster_uptime: | \n",
"03 secs |
\n",
"| H2O_cluster_timezone: | \n",
"Europe/Warsaw |
\n",
"| H2O_data_parsing_timezone: | \n",
"UTC |
\n",
"| H2O_cluster_version: | \n",
"3.46.0.7 |
\n",
"| H2O_cluster_version_age: | \n",
"1 month and 23 days |
\n",
"| H2O_cluster_name: | \n",
"H2O_from_python_sasza_cnf7d2 |
\n",
"| H2O_cluster_total_nodes: | \n",
"1 |
\n",
"| H2O_cluster_free_memory: | \n",
"3.859 Gb |
\n",
"| H2O_cluster_total_cores: | \n",
"4 |
\n",
"| H2O_cluster_allowed_cores: | \n",
"4 |
\n",
"| H2O_cluster_status: | \n",
"locked, healthy |
\n",
"| H2O_connection_url: | \n",
"http://127.0.0.1:54321 |
\n",
"| H2O_connection_proxy: | \n",
"{\"http\": null, \"https\": null} |
\n",
"| H2O_internal_security: | \n",
"False |
\n",
"| Python_version: | \n",
"3.12.10 final |
\n",
"
\n",
"
\n"
],
"text/plain": [
"-------------------------- -----------------------------\n",
"H2O_cluster_uptime: 03 secs\n",
"H2O_cluster_timezone: Europe/Warsaw\n",
"H2O_data_parsing_timezone: UTC\n",
"H2O_cluster_version: 3.46.0.7\n",
"H2O_cluster_version_age: 1 month and 23 days\n",
"H2O_cluster_name: H2O_from_python_sasza_cnf7d2\n",
"H2O_cluster_total_nodes: 1\n",
"H2O_cluster_free_memory: 3.859 Gb\n",
"H2O_cluster_total_cores: 4\n",
"H2O_cluster_allowed_cores: 4\n",
"H2O_cluster_status: locked, healthy\n",
"H2O_connection_url: http://127.0.0.1:54321\n",
"H2O_connection_proxy: {\"http\": null, \"https\": null}\n",
"H2O_internal_security: False\n",
"Python_version: 3.12.10 final\n",
"-------------------------- -----------------------------"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Parse progress: |████████████████████████████████████████████████████████████████| (done) 100%\n"
]
}
],
"source": [
"h2o.init()\n",
"hf = h2o.H2OFrame(data)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "523b4cd3-4174-4207-b437-ee714930cbac",
"metadata": {},
"outputs": [],
"source": [
"x = hf.columns[:-1]\n",
"y = 'species'\n",
"hf[y] = hf[y].asfactor() # klasyfikator"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "57187f1c-7341-428c-b5a9-232d605ffcdf",
"metadata": {},
"outputs": [],
"source": [
"train, test = hf.split_frame(ratios=[0.8])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "4705361d-045f-49b2-ae62-96b61e62edeb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AutoML progress: |██\n",
"14:25:09.382: _min_rows param, The dataset size is too small to split for min_rows=100.0: must have at least 200.0 (weighted) rows, but have only 120.0.\n",
"\n",
"█████████████████████████████████████████████████████████████| (done) 100%\n"
]
},
{
"data": {
"text/html": [
"Model Details\n",
"=============\n",
"H2OGeneralizedLinearEstimator : Generalized Linear Modeling\n",
"Model Key: GLM_1_AutoML_1_20250521_142458\n",
"\n",
"\n",
" \n",
"
\n",
"
\n",
" GLM Model: summary\n",
" | \n",
"family | \n",
"link | \n",
"regularization | \n",
"lambda_search | \n",
"number_of_predictors_total | \n",
"number_of_active_predictors | \n",
"number_of_iterations | \n",
"training_frame |
\n",
" | \n",
"multinomial | \n",
"multinomial | \n",
"Ridge ( lambda = 4.397E-5 ) | \n",
"nlambda = 30, lambda.max = 43.968, lambda.min = 4.397E-5, lambda.1se = 4.76E-4 | \n",
"15 | \n",
"12 | \n",
"189 | \n",
"AutoML_1_20250521_142458_training_py_3_sid_bd54 |
\n",
"
\n",
"
\n",
"
\n",
"ModelMetricsMultinomialGLM: glm\n",
"** Reported on train data. **\n",
"\n",
"MSE: 0.0064962546799750085\n",
"RMSE: 0.08059934664732096\n",
"LogLoss: 0.02583526104275212\n",
"Null degrees of freedom: 119\n",
"Residual degrees of freedom: 105\n",
"Null deviance: 260.9916640757084\n",
"Residual deviance: 6.2004626502605085\n",
"AUC table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"AUCPR table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"
\n",
" \n",
"
\n",
"
\n",
" Confusion Matrix: Row labels: Actual class; Column labels: Predicted class\n",
" | setosa | \n",
"versicolor | \n",
"virginica | \n",
"Error | \n",
"Rate |
\n",
" | 42.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0 / 42 |
\n",
"| 0.0 | \n",
"45.0 | \n",
"1.0 | \n",
"0.0217391 | \n",
"1 / 46 |
\n",
"| 0.0 | \n",
"0.0 | \n",
"32.0 | \n",
"0.0 | \n",
"0 / 32 |
\n",
"| 42.0 | \n",
"45.0 | \n",
"33.0 | \n",
"0.0083333 | \n",
"1 / 120 |
\n",
"
\n",
"
\n",
"
\n",
"
\n",
" \n",
"
\n",
"
\n",
" Top-3 Hit Ratios: \n",
" | k | \n",
"hit_ratio |
\n",
" | 1 | \n",
"0.9916667 |
\n",
"| 2 | \n",
"1.0 |
\n",
"| 3 | \n",
"1.0 |
\n",
"
\n",
"
\n",
"
\n",
"ModelMetricsMultinomialGLM: glm\n",
"** Reported on cross-validation data. **\n",
"\n",
"MSE: 0.0166173490471575\n",
"RMSE: 0.12890829704544818\n",
"LogLoss: 0.05335955355419502\n",
"Null degrees of freedom: 119\n",
"Residual degrees of freedom: 105\n",
"Null deviance: 261.2275216133223\n",
"Residual deviance: 12.806292853006806\n",
"AUC table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"AUCPR table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"
\n",
" \n",
"
\n",
"
\n",
" Confusion Matrix: Row labels: Actual class; Column labels: Predicted class\n",
" | setosa | \n",
"versicolor | \n",
"virginica | \n",
"Error | \n",
"Rate |
\n",
" | 42.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0 / 42 |
\n",
"| 0.0 | \n",
"44.0 | \n",
"2.0 | \n",
"0.0434783 | \n",
"2 / 46 |
\n",
"| 0.0 | \n",
"1.0 | \n",
"31.0 | \n",
"0.03125 | \n",
"1 / 32 |
\n",
"| 42.0 | \n",
"45.0 | \n",
"33.0 | \n",
"0.025 | \n",
"3 / 120 |
\n",
"
\n",
"
\n",
"
\n",
"
\n",
" \n",
"
\n",
"
\n",
" Top-3 Hit Ratios: \n",
" | k | \n",
"hit_ratio |
\n",
" | 1 | \n",
"0.975 |
\n",
"| 2 | \n",
"1.0 |
\n",
"| 3 | \n",
"1.0 |
\n",
"
\n",
"
\n",
"
\n",
"\n",
" \n",
"
\n",
"
\n",
" Cross-Validation Metrics Summary: \n",
" | \n",
"mean | \n",
"sd | \n",
"cv_1_valid | \n",
"cv_2_valid | \n",
"cv_3_valid | \n",
"cv_4_valid | \n",
"cv_5_valid |
\n",
" | accuracy | \n",
"0.975 | \n",
"0.0228218 | \n",
"0.9583333 | \n",
"1.0 | \n",
"0.9583333 | \n",
"1.0 | \n",
"0.9583333 |
\n",
"| aic | \n",
"nan | \n",
"0.0 | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan |
\n",
"| auc | \n",
"nan | \n",
"0.0 | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan |
\n",
"| err | \n",
"0.025 | \n",
"0.0228218 | \n",
"0.0416667 | \n",
"0.0 | \n",
"0.0416667 | \n",
"0.0 | \n",
"0.0416667 |
\n",
"| err_count | \n",
"0.6 | \n",
"0.5477226 | \n",
"1.0 | \n",
"0.0 | \n",
"1.0 | \n",
"0.0 | \n",
"1.0 |
\n",
"| loglikelihood | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 | \n",
"0.0 |
\n",
"| logloss | \n",
"0.0523835 | \n",
"0.0409997 | \n",
"0.0649302 | \n",
"0.0097527 | \n",
"0.1088005 | \n",
"0.0145240 | \n",
"0.0639103 |
\n",
"| max_per_class_error | \n",
"0.0707936 | \n",
"0.0665115 | \n",
"0.1111111 | \n",
"0.0 | \n",
"0.1 | \n",
"0.0 | \n",
"0.1428571 |
\n",
"| mean_per_class_accuracy | \n",
"0.9764021 | \n",
"0.0221705 | \n",
"0.962963 | \n",
"1.0 | \n",
"0.9666666 | \n",
"1.0 | \n",
"0.9523810 |
\n",
"| mean_per_class_error | \n",
"0.0235979 | \n",
"0.0221705 | \n",
"0.0370370 | \n",
"0.0 | \n",
"0.0333333 | \n",
"0.0 | \n",
"0.0476191 |
\n",
"| mse | \n",
"0.0160940 | \n",
"0.0144651 | \n",
"0.0208808 | \n",
"0.0015302 | \n",
"0.0363677 | \n",
"0.0026048 | \n",
"0.0190864 |
\n",
"| null_deviance | \n",
"52.245502 | \n",
"0.3355305 | \n",
"52.057896 | \n",
"52.057896 | \n",
"51.899406 | \n",
"52.60616 | \n",
"52.60616 |
\n",
"| pr_auc | \n",
"nan | \n",
"0.0 | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan | \n",
"nan |
\n",
"| r2 | \n",
"0.9730649 | \n",
"0.0249464 | \n",
"0.965734 | \n",
"0.9974889 | \n",
"0.9369042 | \n",
"0.9958206 | \n",
"0.9693767 |
\n",
"| residual_deviance | \n",
"2.5144098 | \n",
"1.9679834 | \n",
"3.116652 | \n",
"0.4681316 | \n",
"5.222422 | \n",
"0.6971506 | \n",
"3.067692 |
\n",
"| rmse | \n",
"0.1127028 | \n",
"0.0651159 | \n",
"0.1445021 | \n",
"0.0391180 | \n",
"0.1907032 | \n",
"0.0510375 | \n",
"0.1381534 |
\n",
"
\n",
"
\n",
"
\n",
"\n",
" \n",
"
\n",
"
\n",
" Scoring History: \n",
" | \n",
"timestamp | \n",
"duration | \n",
"iteration | \n",
"lambda | \n",
"predictors | \n",
"deviance_train | \n",
"deviance_xval | \n",
"deviance_se | \n",
"alpha | \n",
"iterations | \n",
"training_rmse | \n",
"training_logloss | \n",
"training_r2 | \n",
"training_classification_error | \n",
"training_auc | \n",
"training_pr_auc |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.000 sec | \n",
"2 | \n",
",44E2 | \n",
"15 | \n",
"2.1337309 | \n",
"2.1437919 | \n",
"0.0061275 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.009 sec | \n",
"4 | \n",
",27E2 | \n",
"15 | \n",
"2.1098235 | \n",
"2.1244471 | \n",
"0.0060192 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.019 sec | \n",
"6 | \n",
",17E2 | \n",
"15 | \n",
"2.0731602 | \n",
"2.0944553 | \n",
"0.0059430 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.029 sec | \n",
"8 | \n",
",11E2 | \n",
"15 | \n",
"2.0184793 | \n",
"2.0490558 | \n",
"0.0059270 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.037 sec | \n",
"10 | \n",
",65E1 | \n",
"15 | \n",
"1.9402184 | \n",
"1.9826580 | \n",
"0.0061172 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.066 sec | \n",
"12 | \n",
",41E1 | \n",
"15 | \n",
"1.8345646 | \n",
"1.8903727 | \n",
"0.0067935 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.078 sec | \n",
"15 | \n",
",25E1 | \n",
"15 | \n",
"1.7018876 | \n",
"1.7704198 | \n",
"0.0082597 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.093 sec | \n",
"18 | \n",
",16E1 | \n",
"15 | \n",
"1.5495940 | \n",
"1.6263606 | \n",
"0.0106721 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.104 sec | \n",
"21 | \n",
",97E0 | \n",
"15 | \n",
"1.3887191 | \n",
"1.4685660 | \n",
"0.0137654 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:08 | \n",
" 0.116 sec | \n",
"24 | \n",
",6E0 | \n",
"15 | \n",
"1.2306718 | \n",
"1.3085500 | \n",
"0.0173156 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
"| --- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- | \n",
"--- |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.286 sec | \n",
"69 | \n",
",32E-2 | \n",
"15 | \n",
"0.1894601 | \n",
"0.2244898 | \n",
"0.0322916 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.304 sec | \n",
"76 | \n",
",2E-2 | \n",
"15 | \n",
"0.1586333 | \n",
"0.1928695 | \n",
"0.0319525 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.324 sec | \n",
"84 | \n",
",12E-2 | \n",
"15 | \n",
"0.1346466 | \n",
"0.1689268 | \n",
"0.0317095 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.348 sec | \n",
"92 | \n",
",77E-3 | \n",
"15 | \n",
"0.1157603 | \n",
"0.1516053 | \n",
"0.0316340 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.373 sec | \n",
"102 | \n",
",48E-3 | \n",
"15 | \n",
"0.1005415 | \n",
"0.1383944 | \n",
"0.0320129 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.407 sec | \n",
"114 | \n",
",3E-3 | \n",
"15 | \n",
"0.0880068 | \n",
"0.1287729 | \n",
"0.0328076 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.439 sec | \n",
"128 | \n",
",18E-3 | \n",
"15 | \n",
"0.0772514 | \n",
"0.1214970 | \n",
"0.0339798 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.482 sec | \n",
"146 | \n",
",11E-3 | \n",
"15 | \n",
"0.0676110 | \n",
"0.1154711 | \n",
"0.0352266 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.525 sec | \n",
"166 | \n",
",71E-4 | \n",
"15 | \n",
"0.0590318 | \n",
"0.1104485 | \n",
"0.0365780 | \n",
"0.0 | \n",
"None | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" |
\n",
" | \n",
"2025-05-21 14:25:09 | \n",
" 0.586 sec | \n",
"189 | \n",
",44E-4 | \n",
"15 | \n",
"0.0516705 | \n",
"0.1067191 | \n",
"0.0377878 | \n",
"0.0 | \n",
"189 | \n",
"0.0805993 | \n",
"0.0258353 | \n",
"0.9893456 | \n",
"0.0083333 | \n",
"nan | \n",
"nan |
\n",
"
\n",
"
\n",
"
[30 rows x 17 columns]
\n",
"\n",
" \n",
"
\n",
"
\n",
" Variable Importances: \n",
" | variable | \n",
"relative_importance | \n",
"scaled_importance | \n",
"percentage |
\n",
" | petal_width | \n",
"24.0577316 | \n",
"1.0 | \n",
"0.4077040 |
\n",
"| petal_length | \n",
"22.1722755 | \n",
"0.9216279 | \n",
"0.3757513 |
\n",
"| sepal_width | \n",
"7.5310163 | \n",
"0.3130393 | \n",
"0.1276274 |
\n",
"| sepal_length | \n",
"5.2468195 | \n",
"0.2180929 | \n",
"0.0889173 |
\n",
"
\n",
"
\n",
"
\n",
"\n",
"[tips]\n",
"Use `model.explain()` to inspect the model.\n",
"--\n",
"Use `h2o.display.toggle_user_tips()` to switch on/off this section."
],
"text/plain": [
"Model Details\n",
"=============\n",
"H2OGeneralizedLinearEstimator : Generalized Linear Modeling\n",
"Model Key: GLM_1_AutoML_1_20250521_142458\n",
"\n",
"\n",
"GLM Model: summary\n",
" family link regularization lambda_search number_of_predictors_total number_of_active_predictors number_of_iterations training_frame\n",
"-- ----------- ----------- --------------------------- ------------------------------------------------------------------------------ ---------------------------- ----------------------------- ---------------------- -----------------------------------------------\n",
" multinomial multinomial Ridge ( lambda = 4.397E-5 ) nlambda = 30, lambda.max = 43.968, lambda.min = 4.397E-5, lambda.1se = 4.76E-4 15 12 189 AutoML_1_20250521_142458_training_py_3_sid_bd54\n",
"\n",
"ModelMetricsMultinomialGLM: glm\n",
"** Reported on train data. **\n",
"\n",
"MSE: 0.0064962546799750085\n",
"RMSE: 0.08059934664732096\n",
"LogLoss: 0.02583526104275212\n",
"Null degrees of freedom: 119\n",
"Residual degrees of freedom: 105\n",
"Null deviance: 260.9916640757084\n",
"Residual deviance: 6.2004626502605085\n",
"AUC table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"AUCPR table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"\n",
"Confusion Matrix: Row labels: Actual class; Column labels: Predicted class\n",
"setosa versicolor virginica Error Rate\n",
"-------- ------------ ----------- ---------- -------\n",
"42 0 0 0 0 / 42\n",
"0 45 1 0.0217391 1 / 46\n",
"0 0 32 0 0 / 32\n",
"42 45 33 0.00833333 1 / 120\n",
"\n",
"Top-3 Hit Ratios: \n",
"k hit_ratio\n",
"--- -----------\n",
"1 0.991667\n",
"2 1\n",
"3 1\n",
"\n",
"ModelMetricsMultinomialGLM: glm\n",
"** Reported on cross-validation data. **\n",
"\n",
"MSE: 0.0166173490471575\n",
"RMSE: 0.12890829704544818\n",
"LogLoss: 0.05335955355419502\n",
"Null degrees of freedom: 119\n",
"Residual degrees of freedom: 105\n",
"Null deviance: 261.2275216133223\n",
"Residual deviance: 12.806292853006806\n",
"AUC table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"AUCPR table was not computed: it is either disabled (model parameter 'auc_type' was set to AUTO or NONE) or the domain size exceeds the limit (maximum is 50 domains).\n",
"\n",
"Confusion Matrix: Row labels: Actual class; Column labels: Predicted class\n",
"setosa versicolor virginica Error Rate\n",
"-------- ------------ ----------- --------- -------\n",
"42 0 0 0 0 / 42\n",
"0 44 2 0.0434783 2 / 46\n",
"0 1 31 0.03125 1 / 32\n",
"42 45 33 0.025 3 / 120\n",
"\n",
"Top-3 Hit Ratios: \n",
"k hit_ratio\n",
"--- -----------\n",
"1 0.975\n",
"2 1\n",
"3 1\n",
"\n",
"Cross-Validation Metrics Summary: \n",
" mean sd cv_1_valid cv_2_valid cv_3_valid cv_4_valid cv_5_valid\n",
"----------------------- --------- --------- ------------ ------------ ------------ ------------ ------------\n",
"accuracy 0.975 0.0228218 0.958333 1 0.958333 1 0.958333\n",
"aic nan 0 nan nan nan nan nan\n",
"auc nan 0 nan nan nan nan nan\n",
"err 0.025 0.0228218 0.0416667 0 0.0416667 0 0.0416667\n",
"err_count 0.6 0.547723 1 0 1 0 1\n",
"loglikelihood 0 0 0 0 0 0 0\n",
"logloss 0.0523835 0.0409997 0.0649302 0.00975274 0.1088 0.014524 0.0639103\n",
"max_per_class_error 0.0707936 0.0665115 0.111111 0 0.1 0 0.142857\n",
"mean_per_class_accuracy 0.976402 0.0221705 0.962963 1 0.966667 1 0.952381\n",
"mean_per_class_error 0.0235979 0.0221705 0.037037 0 0.0333333 0 0.0476191\n",
"mse 0.016094 0.0144651 0.0208808 0.00153022 0.0363677 0.00260483 0.0190864\n",
"null_deviance 52.2455 0.33553 52.0579 52.0579 51.8994 52.6062 52.6062\n",
"pr_auc nan 0 nan nan nan nan nan\n",
"r2 0.973065 0.0249464 0.965734 0.997489 0.936904 0.995821 0.969377\n",
"residual_deviance 2.51441 1.96798 3.11665 0.468132 5.22242 0.697151 3.06769\n",
"rmse 0.112703 0.0651159 0.144502 0.039118 0.190703 0.0510375 0.138153\n",
"\n",
"Scoring History: \n",
" timestamp duration iteration lambda predictors deviance_train deviance_xval deviance_se alpha iterations training_rmse training_logloss training_r2 training_classification_error training_auc training_pr_auc\n",
"--- ------------------- ---------- ----------- -------- ------------ ------------------- ------------------- -------------------- ------- ------------ ------------------- ------------------- ------------------ ------------------------------- -------------- -----------------\n",
" 2025-05-21 14:25:08 0.000 sec 2 ,44E2 15 2.133730863902864 2.143791870671952 0.006127485167832629 0.0\n",
" 2025-05-21 14:25:08 0.009 sec 4 ,27E2 15 2.109823497004997 2.124447052133733 0.006019190334986377 0.0\n",
" 2025-05-21 14:25:08 0.019 sec 6 ,17E2 15 2.073160199909241 2.094455325248478 0.005943024319550815 0.0\n",
" 2025-05-21 14:25:08 0.029 sec 8 ,11E2 15 2.018479322918903 2.049055765143296 0.005927012538951306 0.0\n",
" 2025-05-21 14:25:08 0.037 sec 10 ,65E1 15 1.9402184105915015 1.9826579902297001 0.006117181207132829 0.0\n",
" 2025-05-21 14:25:08 0.066 sec 12 ,41E1 15 1.8345645682634668 1.8903726945119605 0.006793505863131489 0.0\n",
" 2025-05-21 14:25:08 0.078 sec 15 ,25E1 15 1.7018876431332406 1.770419793586073 0.00825974339616678 0.0\n",
" 2025-05-21 14:25:08 0.093 sec 18 ,16E1 15 1.549594019755228 1.626360624800752 0.010672125419873993 0.0\n",
" 2025-05-21 14:25:08 0.104 sec 21 ,97E0 15 1.3887191064195916 1.4685659565224465 0.013765387525882756 0.0\n",
" 2025-05-21 14:25:08 0.116 sec 24 ,6E0 15 1.230671777708392 1.3085499773065608 0.01731558636398283 0.0\n",
"--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n",
" 2025-05-21 14:25:09 0.286 sec 69 ,32E-2 15 0.18946005379115832 0.22448978146133225 0.03229160249507911 0.0\n",
" 2025-05-21 14:25:09 0.304 sec 76 ,2E-2 15 0.1586333130483982 0.19286946059058724 0.0319524676158399 0.0\n",
" 2025-05-21 14:25:09 0.324 sec 84 ,12E-2 15 0.13464664873996973 0.16892678250168502 0.03170950741963931 0.0\n",
" 2025-05-21 14:25:09 0.348 sec 92 ,77E-3 15 0.11576029587087913 0.15160526037916444 0.031634046547799576 0.0\n",
" 2025-05-21 14:25:09 0.373 sec 102 ,48E-3 15 0.10054152835462461 0.13839439593696545 0.03201294777566429 0.0\n",
" 2025-05-21 14:25:09 0.407 sec 114 ,3E-3 15 0.08800680617924246 0.12877291886068756 0.03280757994614725 0.0\n",
" 2025-05-21 14:25:09 0.439 sec 128 ,18E-3 15 0.07725142038556079 0.12149697003092079 0.03397976185390619 0.0\n",
" 2025-05-21 14:25:09 0.482 sec 146 ,11E-3 15 0.06761100929528671 0.11547114534552119 0.03522659584217499 0.0\n",
" 2025-05-21 14:25:09 0.525 sec 166 ,71E-4 15 0.05903181216772587 0.11044846010401099 0.03657803672695835 0.0\n",
" 2025-05-21 14:25:09 0.586 sec 189 ,44E-4 15 0.05167052208550425 0.10671910710838992 0.03778780546070541 0.0 189 0.08059934664732096 0.02583526104275212 0.9893455504109749 0.008333333333333333 nan nan\n",
"[30 rows x 17 columns]\n",
"\n",
"\n",
"Variable Importances: \n",
"variable relative_importance scaled_importance percentage\n",
"------------ --------------------- ------------------- ------------\n",
"petal_width 24.0577 1 0.407704\n",
"petal_length 22.1723 0.921628 0.375751\n",
"sepal_width 7.53102 0.313039 0.127627\n",
"sepal_length 5.24682 0.218093 0.0889173\n",
"\n",
"[tips]\n",
"Use `model.explain()` to inspect the model.\n",
"--\n",
"Use `h2o.display.toggle_user_tips()` to switch on/off this section."
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"aml = H2OAutoML(max_models=10, seed=1)\n",
"aml.train(x=x, y=y, training_frame=train)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "75c5a4bc-f018-42f2-a6a1-b435c12c3029",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"glm prediction progress: |███████████████████████████████████████████████████████| (done) 100%\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"| predict | setosa | versicolor | virginica |
\n",
"\n",
"\n",
"| setosa | 0.999928 | 7.21647e-05 | 8.5428e-34 |
\n",
"| setosa | 0.99983 | 0.000169755 | 3.19529e-38 |
\n",
"| setosa | 0.999808 | 0.000191756 | 8.41246e-34 |
\n",
"| setosa | 0.997104 | 0.00289629 | 1.14583e-28 |
\n",
"| setosa | 0.996121 | 0.00387855 | 1.09209e-30 |
\n",
"| setosa | 0.99941 | 0.00059029 | 1.03092e-31 |
\n",
"| setosa | 0.996053 | 0.00394737 | 5.61059e-31 |
\n",
"| setosa | 0.999942 | 5.80918e-05 | 3.96212e-33 |
\n",
"| versicolor | 6.90548e-08 | 0.99984 | 0.000159472 |
\n",
"| versicolor | 7.55608e-05 | 0.999924 | 6.65662e-09 |
\n",
"\n",
"
[10 rows x 4 columns]
"
],
"text/plain": [
"predict setosa versicolor virginica\n",
"---------- ----------- ------------ -----------\n",
"setosa 0.999928 7.21647e-05 8.5428e-34\n",
"setosa 0.99983 0.000169755 3.19529e-38\n",
"setosa 0.999808 0.000191756 8.41246e-34\n",
"setosa 0.997104 0.00289629 1.14583e-28\n",
"setosa 0.996121 0.00387855 1.09209e-30\n",
"setosa 0.99941 0.00059029 1.03092e-31\n",
"setosa 0.996053 0.00394737 5.61059e-31\n",
"setosa 0.999942 5.80918e-05 3.96212e-33\n",
"versicolor 6.90548e-08 0.99984 0.000159472\n",
"versicolor 7.55608e-05 0.999924 6.65662e-09\n",
"[10 rows x 4 columns]\n"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"preds = aml.leader.predict(test)\n",
"preds.head()"
]
},
{
"cell_type": "markdown",
"id": "d594a3e6-19d3-4c18-8ce1-b3adc73736a9",
"metadata": {},
"source": [
"# Sieci DQN\n",
"## Gymnasium"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "68f0a136-a2ed-4905-b469-345b28329a2e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0dd52bb4-fa30-487f-819a-8a633a79cdb0",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}