Create AutoAI Tools.ipynb

master
benjas 4 years ago
parent ffe67da3da
commit 1bfdc4be85

@ -12,7 +12,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c153ba08",
"id": "b2143f17",
"metadata": {},
"outputs": [],
"source": []

@ -0,0 +1,145 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c32f110a",
"metadata": {},
"source": [
"# 自动机器学习工具\n",
"该notebook将比较市面上的多个AutoML工具分别采用两组数据集进行比较分别是波士顿房价回归和森林植被类型多分类"
]
},
{
"cell_type": "markdown",
"id": "ba41b787",
"metadata": {},
"source": [
"# optuna一种超参数优化框架\n",
"https://github.com/optuna/optuna"
]
},
{
"cell_type": "markdown",
"id": "c4d7f73a",
"metadata": {},
"source": [
"### 波士顿房价预测任务(回归)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1d010375",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import time\n",
"import gc"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "6d01294d",
"metadata": {},
"outputs": [],
"source": [
"from sklearn.datasets import load_boston\n",
"# 预处理\n",
"X, y = data['data'], data['target']\n",
"# 由于模型标签需要从0开始所以数字需要全部减1\n",
"print('七分类任务,处理前:',np.unique(y))\n",
"print(y)\n",
"ord = OrdinalEncoder()\n",
"y = ord.fit_transform(y.reshape(-1, 1))\n",
"y = y.reshape(-1, )\n",
"print('七分类任务,处理后:',np.unique(y))\n",
"print(y)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "80a90475",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[6.3200e-03, 1.8000e+01, 2.3100e+00, ..., 1.5300e+01, 3.9690e+02,\n",
" 4.9800e+00],\n",
" [2.7310e-02, 0.0000e+00, 7.0700e+00, ..., 1.7800e+01, 3.9690e+02,\n",
" 9.1400e+00],\n",
" [2.7290e-02, 0.0000e+00, 7.0700e+00, ..., 1.7800e+01, 3.9283e+02,\n",
" 4.0300e+00],\n",
" ...,\n",
" [6.0760e-02, 0.0000e+00, 1.1930e+01, ..., 2.1000e+01, 3.9690e+02,\n",
" 5.6400e+00],\n",
" [1.0959e-01, 0.0000e+00, 1.1930e+01, ..., 2.1000e+01, 3.9345e+02,\n",
" 6.4800e+00],\n",
" [4.7410e-02, 0.0000e+00, 1.1930e+01, ..., 2.1000e+01, 3.9690e+02,\n",
" 7.8800e+00]])"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.data"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9977a37c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9193c33",
"metadata": {},
"outputs": [],
"source": [
"### 分类"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "82687da3",
"metadata": {},
"outputs": [],
"source": [
"from sklearn.datasets import fetch_covtype\n",
"data = fetch_covtype()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

@ -1,42 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c32f110a",
"metadata": {},
"source": [
"# 自动机器学习工具\n",
"该notebook将比较市面上的多个AutoML工具分别采用两组数据集进行比较分别是波士顿房价回归和森林植被类型多分类"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c153ba08",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading…
Cancel
Save