{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyNmHgoV+wimoDpo9xMpFxxn"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":4,"metadata":{"id":"BKOKO-XTh5pQ","executionInfo":{"status":"ok","timestamp":1710613913382,"user_tz":-420,"elapsed":312,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}}},"outputs":[],"source":["import numpy as np\n","from sklearn import datasets\n","\n","from sklearn.ensemble import RandomForestRegressor\n","from sklearn.model_selection import train_test_split\n","from sklearn.feature_selection import RFECV\n","import matplotlib.pyplot as plt\n","X,y = datasets.load_iris(return_X_y=True)"]},{"cell_type":"code","source":["X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.33, random_state=42)\n","rf = RandomForestRegressor(random_state=0)\n","\n","rf.fit(X_train,y_train)\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":74},"id":"rznJTheliIWz","executionInfo":{"status":"ok","timestamp":1710613937025,"user_tz":-420,"elapsed":767,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}},"outputId":"0ac70b72-7115-4a8d-820c-5e9d680a75d4"},"execution_count":6,"outputs":[{"output_type":"execute_result","data":{"text/plain":["RandomForestRegressor(random_state=0)"],"text/html":["
RandomForestRegressor(random_state=0)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
"]},"metadata":{},"execution_count":6}]},{"cell_type":"code","source":["features = datasets.load_iris()['feature_names']\n","f_i = list(zip(features,rf.feature_importances_))\n","f_i.sort(key = lambda x : x[1])\n","plt.barh([x[0] for x in f_i],[x[1] for x in f_i])\n","\n","plt.show()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":430},"id":"LObPxQ3iiTEH","executionInfo":{"status":"ok","timestamp":1710613975011,"user_tz":-420,"elapsed":671,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}},"outputId":"9f2c8bbd-f987-40e2-f5fc-443fa3ed0262"},"execution_count":9,"outputs":[{"output_type":"display_data","data":{"text/plain":["
"],"image/png":"iVBORw0KGgoAAAANSUhEUgAAAocAAAGdCAYAAABgsdmCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAzBklEQVR4nO3de3zP9f//8fvbZgd2YDYb2UzGKMMyZMXWN7VKviQl9c1pUR98U5kkxBKWEKkktEmyJMm3E7XaHHNqcj401qj1kUObmYbt9fvDb89Pb0zbbNbW7Xq5vC6XvV6v5+v5fLyfF9m95+v1erNZlmUJAAAAkFStogsAAADA3wfhEAAAAAbhEAAAAAbhEAAAAAbhEAAAAAbhEAAAAAbhEAAAAAbhEAAAAIZjRReAyqegoEC//PKL3N3dZbPZKrocAABQDJZl6dSpU6pfv76qVSt6fZBwiBL75Zdf5O/vX9FlAACAUjh8+LAaNGhQ5HnCIUrM3d1d0oU/XB4eHhVcDQAAKI7s7Gz5+/ub3+NFIRyixApvJXt4eBAOAQCoZP7qkTBeSAEAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIBBOAQAAIDhWNEFoPJqMW6lqjnXqOgyAACoMtLjulR0CawcAgAA4D8IhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADAIhwAAADCqTDhMTk6WzWbT77//Xib99evXT927d79im8jISD311FNXbJ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RDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGIRDAAAAGJUuHCYnJ8tms+n3338vso3NZtPy5cuvWU1XMn78eLVu3bpU1z766KOaNGlS2RZ0kYceekjTpk0r1zEAAEDlUWHhMCEhQbVq1aqo4ctFWYbSH374QZ9//rmefPLJMumvKGPGjNHEiROVlZVVruMAAIDKodKtHP5TzJo1Sw888IDc3NzKdZwWLVqocePGeu+998p1HAAAUDmUKhxGRkZq6NChGjp0qDw9PeXt7a2xY8fKsizTJi8vTzExMbruuutUs2ZNtW/fXsnJyZIu3Bru37+/srKyZLPZZLPZNH78eEnSwoULFRYWJnd3d/n5+enhhx/W0aNHr+pDHj58WA8++KBq1aolLy8vdevWTenp6eZ8v3791L17d02dOlX16tVTnTp1NGTIEJ07d860yczMVJcuXeTq6qpGjRrp/fffV2BgoGbMmCFJCgwMlCTdd999stlsZr/QwoULFRgYKE9PTz300EM6depUkfXm5+dr6dKl6tq1q93xvLw8jRw5Uv7+/nJ2dlZQUJDmz58v6T+321euXKnQ0FC5urrqv/7rv3T06FF98cUXat68uTw8PPTwww8rNzfXrt+uXbsqMTGxhLMKAACqolKvHC5YsECOjo7atGmTZs6cqenTp2vevHnm/NChQ7VhwwYlJiZq+/bteuCBB3TXXXfpwIEDCg8P14wZM+Th4aHMzExlZmYqJiZGknTu3DlNmDBBP/zwg5YvX6709HT169ev1B/w3LlzioqKkru7u9asWaN169bJzc1Nd911l86ePWvaffvtt0pLS9O3336rBQsWKCEhQQkJCeZ8nz599Msvvyg5OVkfffSR3n77bbvQunnzZklSfHy8MjMzzb4kpaWlafny5fr000/16aefKiUlRXFxcUXWvH37dmVlZSksLMzueJ8+fbR48WK99tpr2rNnj+bMmXPJyuL48eP1+uuva/369SYUz5gxQ++//74+++wzrVq1SrNmzbK7pl27dtq0aZPy8vIuW09eXp6ys7PtNgAAUDU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WratKkeeeQR9enTR8uWLdOhQ4e0adMmTZ48WZ999pmkC7dac3JylJSUpGPHjik3N1cBAQFycnLSrFmzdPDgQa1YsUITJky4qg/4yCOPyNvbW926ddOaNWt06NAhJScn68knn9SRI0eK1UezZs3UuXNnDRo0SJs2bVJqaqoGDRokV1dXu1u/gYGBSkpK0q+//npJcCwJHx8f3XTTTVq7dq1d33379tWAAQO0fPly8zmWLFlS6nEKrVmzxjx7CQAA/tlKHQ779OmjM2fOqF27dhoyZIiGDRumQYMGmfPx8fHq06ePhg8fruDgYHXv3l2bN29WQECAJCk8PFxPPPGEevXqJR8fH02ZMkU+Pj5KSEjQhx9+qBtuuEFxcXGaOnXqVX3AGjVqaPXq1QoICFCPHj3UvHlzRUdH648//ijRSuK7774rX19fderUSffdd58GDhwod3d3ubi4mDbTpk3TV199JX9/f4WGhl5V3Y899tglt8Jnz56tnj17avDgwWrWrJkGDhyo06dPX9U4f/zxh5YvX66BAwdeVT8AAKBqsFl//nLCYoqMjFTr1q3Nd/z9Ex05ckT+/v76+uuvdfvtt5d5/2fOnFFwcLA++OADdejQocz7LzR79mx9/PHHWrVqVbGvyc7Olqenp/yfWqJqzjXKrTYAACqr9LguFV3CJQp/f2dlZV1xgaxcXkipir755hvl5OQoJCREmZmZevbZZxUYGKhOnTqVy3iurq569913dezYsXLpv1D16tUv+d5DAADwz0U4LKZz587p+eef18GDB+Xu7q7w8HAtWrTokreBy1JkZGS59V3oscceK/cxAABA5VGqcFj4z+D9kxR+xQ4AAEBVVuoXUgAAAFD1EA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgEA4BAABgOFZ0Aai8dsZGycPDo6LLAAAAZYiVQwAAABiEQwAAABiEQwAAABiEQwAAABiEQwAA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ISEyMvLSykpKXbhMCUlRZs3b9a5c+fK7c3g6tWr2+3bbDa728EX8/b2NgG70J9vU5dknOKMfeLECfn4+BTZr7Ozszw8POw2AABQNZXJCyk2m0233HKLYmNjlZqaKicnJ3388cfy9fVV/fr1dfDgQQUFBdltjRo1suvjz2Hx/Pnz2rp1q5o3by5JWrduncLDwzV48GCFhoYqKCjokpXH4tTYsWNHffLJJ9q1a5duvfVWtWzZUnl5eZozZ47CwsJUs2bNy17bvHlzbd++XX/88cdl65UufC2MdOHlmasVGhqqvXv3muc2pQurj9u2bdOJEyeuuv+L7dy5U6GhoWXeLwAAqHyuOhxu3LhRkyZN0pYtW5SRkaFly5bpt99+M8EuNjZWkydP1muvvab9+/drx44dio+P1/Tp0+36eeONN/Txxx9r7969GjJkiE6ePKkBAwZIuvCc3pYtW7Ry5Urt379fY8eO1ebNm0tca2RkpBYvXqzWrVvLzc1N1apVU6dOnbRo0aIinzeUpIcfflg2m00DBw7U7t279fnnn2vq1Kl2bRo2bCibzaZPP/1Uv/32m1k1LY3bbrtNOTk5dl8v07t3b/n5+al79+5at26dDh48qI8++kgbNmwo9TiF1qxZozvvvPOq+wEAAJXfVYdDDw8PrV69Wvfcc4+aNm2qMWPGaNq0aeYLpB977DHNmzdP8fHxCgkJUUREhBISEi5ZOYyLi1NcXJxatWqltWvXasWKFfL29pYkPf744+rRo4d69eql9u3b6/jx4xo8eHCJa42IiFB+fr7ds4WRkZGXHLuYm5ub/u///k87duxQaGioRo8erZdfftmuzXXXXafY2Fg999xz8vX11dChQ0tcX6E6derovvvu06JFi8wxJycnrVq1SnXr1tU999yjkJAQxcXFycHBodTjSNKGDRuUlZWlnj17XlU/AACgarBZf753WQHS09PVqFEjpaamqnXr1hVZyt/K9u3bdccddygtLU1ubm7lNk6vXr3UqlUrPf/888W+Jjs7W56envJ/aomqOV/61T9FSY/r8teNAABAuSj8/Z2VlXXF9wf4F1L+plq2bKmXX35Zhw4dKrcxzp49q5CQED399NPlNgYAAKhcrvp7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UNNmjTRihUr7PpYsWKFmjRpIhcXF912221asGCBbDabfv/9dyUnJ6t///7KysqSzWaTzWbT+PHjzbW5ubkaMGCA3N3dFRAQoLfffvuK9X7++edydnbWzTffbHd8165duvfee+Xh4SF3d3d17NhRaWlpkv5zu33SpEny9fVVrVq19OKLL+r8+fMaMWKEvLy81KBBA8XHx9v1eeONN6p+/fr6+OOPSzO1AACgiil2OMzMzFTv3r01YMAA7dmzR8nJyerRo4csy5IkLVq0SC+88IImTpyoPXv2aNKkSRo7dqwWLFhg18+IESM0fPhwpaamqkOHDuratauOHz8uSSooKFCDBg304Ycfavfu3XrhhRf0/PPPa8mSJaX+gGvWrFGfPn00bNgw7d69W3PmzFFCQoImTpxo1y42NlYPPvigtm/frnvuuUePPPKIWU07dOiQevbsqe7du+uHH37Q448/rtGjR5trw8PDNWPGDHl4eCgzM1OZmZmKiYkx56dNm6awsDClpqZq8ODB+te//qV9+/ZdseY2bdrYHfv555/VqVMnOTs765tvvtHWrVs1YMAAu5D7zTff6JdfftHq1as1ffp0jRs3Tvfee69q166tjRs36oknntDjjz9+yTOG7dq105o1a4qsJy8vT9nZ2XYbAACooqxi2rp1qyXJSk9Pv+z5xo0bW++//77dsQkTJlgdOnSwLMuyDh06ZEmy4uLizPlz585ZDRo0sF5++eUixx0yZIh1//33m/2+ffta3bp1K7J9fHy85enpafZvv/12a9KkSXZtFi5caNWrV8/sS7LGjBlj9nNycixJ1hdffGFZlmWNHDnSatGihV0fo0ePtiRZJ0+evOy4hRo2bGj9z//8j9kvKCiw6tata82ePbvIz9CtWzdrwIABdsdGjRplNWrUyDp79uxlr+nbt6/VsGFDKz8/3xwLDg62OnbsaPbPnz9v1axZ01q8eLHdtU8//bQVGRlZZD3jxo2zJF2y+T+1xGo48lO7DQAA/D1lZWVZkqysrKwrtnMsbohs1aqVbr/9doWEhCgqKkp33nmnevbsqdq1a+v06dNKS0tTdHS0Bg4caK45f/68PD097frp0KGD+dnR0VFhYWHas2ePOfbGG2/onXfe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X843To0EEdOnQw++Hh4WrevLnmzJmjCRMmlOlYhEPY8fb2loODg/7973/bHf/3v/9d5AsPfn5+JWqPyyvN3KNsXM3cT506VXFxcfr666/VsmXL8iyzSirt3FerVk1BQUGSpNatW2vPnj2aPHky4bAESjr3aWlpSk9PV9euXc2xgoICSZKjo6P27dunxo0bl2/RVURZ/H1fvXp1hYaG6scffyzz+ritDDtOTk5q06aNkpKSzLGCggIlJSXZ/R/Ln3Xo0MGuvSR99dVXRbbH5ZVm7lE2Sjv3U6ZM0YQJE/Tll18qLCzsWpRa5ZTVn/uCggLl5eWVR4lVVknnvlmzZtqxY4e2bdtmtv/+7//Wbbfdpm3btsnf3/9all+plcWf+/z8fO3YsUP16tUr+wKvyWsvqFQSExMtZ2dnKyEhwdq9e7c1aNAgq1atWtavv/5qWZZlPfroo9Zzzz1n2q9bt85ydHS0pk6dau3Zs8caN26cVb16dWvHjh0V9REqrZLOfV5enpWammqlpqZa9erVs2JiYqzU1FTrwIEDFfURKq2Szn1cXJzl5ORkLV261MrMzDTbqVOnKuojVFolnftJkyZZq1atstLS0qzdu3dbU6dOtRwdHa25c+dW1EeotEo69xfjbeXSK+ncx8bGWitXrrTS0tKsrVu3Wg899JDl4uJi7dq1q8xrIxzismbNmmUFBARYTk5OVrt27azvvvvOnIuIiLD69u1r137JkiVW06ZNLScnJ+vGG2+0Pvvss2tccdVRkrk/dOiQJemSLSIi4toXXgWUZO4bNmx42bkfN27ctS+8CijJ3I8ePdoKCgqyXFxcrNq1a1sdOnSwEhMTK6DqqqGkf9//GeHw6pRk7p966inT1tfX17rnnnus77//vlzqslmWZZX9eiQAAAAqI545BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgEE4BAAAgPH/ACTp4m4wARK+AAAAAElFTkSuQmCC\n"},"metadata":{}}]},{"cell_type":"code","source":["rfe = RFECV(rf,cv=5,scoring=\"neg_mean_squared_error\")\n","\n","rfe.fit(X_train,y_train)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":117},"id":"jX0hshgZihdE","executionInfo":{"status":"ok","timestamp":1710614007387,"user_tz":-420,"elapsed":10834,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}},"outputId":"0fadff12-6668-4a49-e48f-0fbcfb667bc1"},"execution_count":10,"outputs":[{"output_type":"execute_result","data":{"text/plain":["RFECV(cv=5, estimator=RandomForestRegressor(random_state=0),\n"," scoring='neg_mean_squared_error')"],"text/html":["
RFECV(cv=5, estimator=RandomForestRegressor(random_state=0),\n","      scoring='neg_mean_squared_error')
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
"]},"metadata":{},"execution_count":10}]},{"cell_type":"code","source":["selected_features = np.array(features)[rfe.get_support()]\n","print(selected_features)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"1NKgSoPMilpD","executionInfo":{"status":"ok","timestamp":1710614025232,"user_tz":-420,"elapsed":274,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}},"outputId":"5b451947-55b1-4d50-dffd-6ec1437f7c7c"},"execution_count":12,"outputs":[{"output_type":"stream","name":"stdout","text":["['sepal width (cm)' 'petal length (cm)' 'petal width (cm)']\n"]}]}]}