{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# to install pycaret-nightly\n", "# pip install pycaret-nightly" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pycaret.utils import version\n", "version()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Load Dataset" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pycaret.datasets import get_data\n", "data = get_data('boston')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 2. Initialize setup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pycaret.regression import *\n", "reg1 = setup(data, target = 'medv', logging=True, experiment_name='boston-tf-meetup-temp')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 3. Compare Models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "top5 = compare_models(n_select = 5)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(top5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 3. Blend Models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "blender = blend_models(estimator_list = top5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 4. Stack Models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "stacker = stack_models(estimator_list = top5[1:], meta_model = top5[0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 5. Tune Models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "tuned_et = tune_model(top5[1], n_iter=50)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 6. Init MLFlow UI" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!mlflow ui" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "lightgbm = create_model('lightgbm')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "for i in np.arange(0.1,1,0.01):\n", " create_model('lightgbm', learning_rate=i, verbose=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!mlflow ui" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "pycaret-nightly-env", "language": "python", "name": "pycaret-nightly-env" }, "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.6.10" } }, "nbformat": 4, "nbformat_minor": 2 }