{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "660798fa-cf08-4cfd-b553-c6d750d7e7ad",
   "metadata": {},
   "outputs": [],
   "source": [
    "import algo_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ff42670b-301d-4ee1-8da2-6a658fc5f286",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'_id': ObjectId('66ebba82a3b7dbe82538e34a'), 'name': 'Alice', 'age': 25, 'city': 'Beijing'}\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import subprocess\n",
    "\n",
    "# 使用 subprocess 执行 .py 文件\n",
    "result = subprocess.run(['python', 'algo_test.py'], capture_output=True, text=True)\n",
    "\n",
    "# 打印输出\n",
    "print(result.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b47d615a-5953-43c0-9289-387d5c823a7a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-09-26 16:09:24,040 - waitress - INFO - Serving on http://0.0.0.0:10090\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-09-26 16:11:05,381 - model_training_lightgbm log - INFO - {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度, NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n",
      "args {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度, NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n",
      "features:************ ['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向', 'NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向', 'NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向', 'NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向', 'NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射', 'NWP-总降水强度', 'NWP-温度', 'NWP-湿度', ' NWP-气压']\n",
      "Program execution ends!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-09-26 16:11:46,517 - model_training_lightgbm log - INFO - {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n",
      "args {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n",
      "features:************ ['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向', 'NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向', 'NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向', 'NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向', 'NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射', 'NWP-总降水强度', 'NWP-温度', 'NWP-湿度', 'NWP-气压']\n",
      "Starting training...\n",
      "Training completed!\n",
      "Collection 'models already exist, deleted successfully!\n",
      "model inserted successfully!\n",
      "Program execution ends!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-09-26 16:11:57,030 - model_training_lightgbm log - INFO - {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ' '}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n",
      "args {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ' '}\n",
      "features:************ ['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向', 'NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向', 'NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向', 'NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向', 'NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射', 'NWP-总降水强度', 'NWP-温度', 'NWP-湿度', 'NWP-气压', ' ']\n",
      "Program execution ends!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-09-26 16:12:20,633 - model_training_lightgbm log - INFO - {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': \"''\"}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n",
      "args {'numerical_features': 'NWP预测总辐射,NWP-10米预测风速,NWP-10米预测风向,NWP-30米预测风速,NWP-30米预测风向,NWP-50米预测风速,NWP-50米预测风向,NWP-70米预测风速,NWP-70米预测风向,NWP-90米预测风速,NWP-90米预测风向,NWP-110米预测风速,NWP-110米预测风向,NWP-150米预测风速,NWP-150米预测风向,NWP-170米预测风速,NWP-170米预测风向,NWP-低云量,NWP-中云量,NWP-高云量,NWP-总云量,NWP-晴空总辐射,NWP-法相直辐射,NWP-总降水强度,NWP-温度,NWP-湿度,NWP-气压', 'label': '实际功率', 'learning_rate': '0.01', 'num_leaves': '31', 'min_data_in_leaf': '21', 'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017', 'mongodb_database': 'algorithm_platform', 'col_pp': 'predict', 'mongodb_read_table': 'J00260NWP_records', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': \"''\"}\n",
      "features:************ ['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向', 'NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向', 'NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向', 'NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向', 'NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射', 'NWP-总降水强度', 'NWP-温度', 'NWP-湿度', 'NWP-气压', \"''\"]\n",
      "Program execution ends!\n",
      "server start!\n"
     ]
    }
   ],
   "source": [
    " %run model_training_lightgbm.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "752c3ab3-cdef-47b0-9d9a-805348d30d6e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.9.19 (main, May  6 2024, 20:12:36) [MSC v.1916 64 bit (AMD64)]\n"
     ]
    }
   ],
   "source": [
    "parser.add_argument('--numerical_features', type=str, required=True, help=\"数值型特征\") \n",
    "parser.add_argument('--categorical_features', type=str, required=True, help=\"类别型特征\")\n",
    "parser.add_argument('--learning_rate', type=float, required=True, help=\"学习率\")\n",
    "parser.add_argument('--num_leaves', type=int, required=True, help=\"叶子节点数\")\n",
    "parser.add_argument('--min_data_in_leaf', type=int, required=True, help=\"叶子节点最小数据量\")# mongodb://root:Jydl3377@192.168.1.33:27017\n",
    "parser.add_argument('--mongodb_connection', type=str, required=True, help=\"mongodb连接\")# algorithm_platform\n",
    "parser.add_argument('--mongodb_database', type=str, required=True, help=\"mongodb数据库名\")# algorithm_platform\n",
    "parser.add_argument('--mongodb_read_table', type=str, required=True, help=\"mongodb数据库读取表\")# tmp_one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "acc6aa2a-0f1d-43f3-985d-cd37c4a5ac6e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output:\n",
      "Program starts execution!\n",
      "args: Namespace(numerical_features=['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向', 'NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向', 'NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向', 'NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向', 'NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射', 'NWP-总降水强度', 'NWP-温度', 'NWP-湿度', 'NWP-气压'], categorical_features=[], label='实际功率', learning_rate=0.01, num_leaves=31, min_data_in_leaf=21, mongodb_connection='mongodb://root:Jydl3377@192.168.1.33:27017', mongodb_database='algorithm_platform', mongodb_read_table='J00260NWP_records', mongodb_write_table='models', model_name='lightgbm_model')\n",
      "df:************                         _id               C_TIME  ...   NWP-湿度    NWP-气压\n",
      "0  66ecc86f1075358d129a1d56  2024-05-02 22:30:00  ...  23.4918  892.3327\n",
      "1  66ecc86f1075358d129a1d57  2024-05-02 22:45:00  ...  24.0436  892.3809\n",
      "\n",
      "[2 rows x 34 columns]\n",
      "Starting training...\n",
      "[LightGBM] [Info] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000981 seconds.\n",
      "You can set `force_col_wise=true` to remove the overhead.\n",
      "[LightGBM] [Info] Total Bins 6885\n",
      "[LightGBM] [Info] Number of data points in the train set: 7770, number of used features: 27\n",
      "[LightGBM] [Info] Start training from score 47.616663\n",
      "Training completed!\n",
      "Collection 'models already exist, deleted successfully!\n",
      "model inserted successfully!\n",
      "Program execution ends!\n",
      "\n",
      "Error:\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import subprocess\n",
    "\n",
    "# 构建命令\n",
    "command = [\n",
    "    \"python\", \"lightgbm_model.py\",\n",
    "    \"--numerical_features\", ','.join(['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向','NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', \n",
    "                             'NWP-70米预测风向','NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向','NWP-150米预测风速', 'NWP-150米预测风向', \n",
    "                             'NWP-170米预测风速', 'NWP-170米预测风向','NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射','NWP-总降水强度', \n",
    "                             'NWP-温度', 'NWP-湿度', 'NWP-气压']),\n",
    "    \"--categorical_features\", ','.join([]),\n",
    "    \"--label\", \"实际功率\",\n",
    "    \"--learning_rate\", \"0.01\",\n",
    "    \"--num_leaves\", \"31\",\n",
    "    \"--min_data_in_leaf\", \"21\",\n",
    "    \"--mongodb_connection\", \"mongodb://root:Jydl3377@192.168.1.33:27017\",\n",
    "    \"--mongodb_database\", \"algorithm_platform\",\n",
    "    \"--mongodb_read_table\", \"J00260NWP_records\",\n",
    "    \"--mongodb_write_table\", \"models\",\n",
    "    \"--model_name\",\"lightgbm_model\"\n",
    "]\n",
    "\n",
    "# 使用 subprocess.run 来执行命令\n",
    "result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)\n",
    "\n",
    "# 输出结果和错误信息\n",
    "print(\"Output:\")\n",
    "print(result.stdout)\n",
    "print(\"Error:\")\n",
    "print(result.stderr)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "14a9feb4-5625-45d7-8e0f-6a8dea8c9f24",
   "metadata": {},
   "outputs": [],
   "source": [
    "docker run lightgbm_model.py   --numerical_features \"2024-05-01\"     --categorical_features \"2024-09-20\"   --label \"J00260\"     --learning_rate \"C_TIME\"    --num_leaves \"mongodb://root:Jydl3377@192.168.1.33:27017\"     --mongondb_database \"algorithm_platform\"     --mongondb_read_table \"J00260NWP_machines\"     --mongondb_write_table \"J00260NWP_records\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c0d791f8-12d8-4ab9-b561-b474e2a739f0",
   "metadata": {},
   "outputs": [],
   "source": [
    "docker run lightgbm_model.py --numerical_features ','.join(['NWP预测总辐射', 'NWP-10米预测风速', 'NWP-10米预测风向', 'NWP-30米预测风速', 'NWP-30米预测风向','NWP-50米预测风速', 'NWP-50米预测风向', 'NWP-70米预测风速', 'NWP-70米预测风向','NWP-90米预测风速', 'NWP-90米预测风向', 'NWP-110米预测风速', 'NWP-110米预测风向','NWP-150米预测风速', 'NWP-150米预测风向', 'NWP-170米预测风速', 'NWP-170米预测风向','NWP-低云量', 'NWP-中云量', 'NWP-高云量', 'NWP-总云量', 'NWP-晴空总辐射', 'NWP-法相直辐射','NWP-总降水强度', 'NWP-温度', 'NWP-湿度', 'NWP-气压'])  --categorical_features  ','.join([])  --label  \"实际功率\" --learning_rate  \"0.01\" --num_leaves \"31\"  --min_data_in_leaf  \"21\"  --mongodb_connection  \"mongodb://root:Jydl3377@192.168.1.33:27017\" --mongodb_database  \"algorithm_platform\" --mongodb_read_table  \"J00260NWP_records\" --mongodb_write_table  \"models\" --model_name \"lightgbm_model\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8bdd9bd2-4373-4465-b20a-de574fb29436",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-11-21 14:54:47,009 - waitress - INFO - Serving on http://0.0.0.0:10089\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-11-21 14:54:51,021 - model_training_lightgbm log - INFO - {'numerical_features': 'temperature2,direction10,speed10,mcc,solarZenith,dniCalcd,humidity2,hcc,clearskyGhi,lcc,tcc,surfacePressure,tpr,radiation', 'label': 'realPower', 'model_params': \"{'num_leaves': 31,         'learning_rate': 0.1,         'min_data_in_leaf': 21}\", 'num_boost_round': '500', 'mongodb_database': 'db2', 'mongodb_read_table': 'j00629_copy_statistics', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Program starts execution!\n",
      "args {'numerical_features': 'temperature2,direction10,speed10,mcc,solarZenith,dniCalcd,humidity2,hcc,clearskyGhi,lcc,tcc,surfacePressure,tpr,radiation', 'label': 'realPower', 'model_params': \"{'num_leaves': 31,         'learning_rate': 0.1,         'min_data_in_leaf': 21}\", 'num_boost_round': '500', 'mongodb_database': 'db2', 'mongodb_read_table': 'j00629_copy_statistics', 'mongodb_write_table': 'models', 'model_name': 'lightgbm_model', 'categorical_features': ''}\n",
      "features:************ ['temperature2', 'direction10', 'speed10', 'mcc', 'solarZenith', 'dniCalcd', 'humidity2', 'hcc', 'clearskyGhi', 'lcc', 'tcc', 'surfacePressure', 'tpr', 'radiation']\n",
      "Starting training...\n",
      "The test rmse is: 7.095613313100767,\"The test mae is:\"3.0062923664706886\n",
      "Training completed!\n",
      "Collection 'models already exist, deleted successfully!\n",
      "model inserted successfully!\n",
      "Program execution ends!\n"
     ]
    }
   ],
   "source": [
    " %run model_training_lightgbm.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5ae69d4d-fa6e-4a26-95a4-232b55e469b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'a': 1, 'b': 3, 'c': 4}\n"
     ]
    }
   ],
   "source": [
    "temperature2,direction10,speed10,mcc,solarZenith,dniCalcd,humidity2,hcc,clearskyGhi,lcc,tcc,surfacePressure,tpr,radiation"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (panddlets)",
   "language": "python",
   "name": "panddlets"
  },
  "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.9.19"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
