{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyOhtWgRMeSEbihRrS+44NuF"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"BKOKO-XTh5pQ"},"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) # 100 decision trees\n","\n","rf.fit(X_train,y_train)\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":75},"id":"rznJTheliIWz","executionInfo":{"status":"ok","timestamp":1711273187918,"user_tz":-420,"elapsed":545,"user":{"displayName":"Nhật Quang Đoàn","userId":"10175964550021301622"}},"outputId":"64f3999b-4d72-41c5-c14d-e1e01d394488"},"execution_count":null,"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.
RandomForestRegressor(random_state=0)
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.
RFECV(cv=5, estimator=RandomForestRegressor(random_state=0),\n"," scoring='neg_mean_squared_error')
RandomForestRegressor(random_state=0)
RandomForestRegressor(random_state=0)