{ "cells": [ { "cell_type": "markdown", "id": "cfebebd9", "metadata": {}, "source": [ "![](https://www.brainome.ai/wp-content/uploads/2020/08/brainome_logo.png)\n", "# 204 How Smart is My Model?\n", "Introducing Memory Equivalent Capacity to measure how adaptable my model is.\n", "\n", "1. What is MEC?\n", "2. Titanic's MEC with *Random Forest*\n", "3. Titanic's MEC with *Decision Tree*\n", "4. Titanic's MEC with *Neural Network*\n", "5. Using MEC to pick the right model type" ] }, { "cell_type": "markdown", "id": "1474a59d", "metadata": {}, "source": [ "## Prerequisites\n", "This notebook requires brainome as installed per notebook [brainome_101_Quick_Start](brainome_101_Quick_Start.ipynb)\n", "\n", "The training data set used is [titanic_train.csv](https://download.brainome.ai/data/public/titanic_train.csv)." ] }, { "cell_type": "code", "execution_count": null, "id": "a510f157", "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "!python3 -m pip install brainome --quiet\n", "!brainome --version" ] }, { "cell_type": "markdown", "id": "33177319", "metadata": {}, "source": [ "## 1.What is MEC?\n", "The Memory Equivalent Capacity for a machine learner is dependent on the number of parameters used, the topology of the machine learner, the training method, as well as the training efficiency. It can be estimated as an upper limit. Measured in bits.\n", "\n", "Example: A machine learner with 10 bits of Memory Equivalent Capacity is guaranteed to memorize any binary classification task of 10 instances or less.\n", "from the [Brainome Glossary](https://www.brainome.ai/documentation/glossary/#MemoryEquivalentCapacity(MEC))\n" ] }, { "cell_type": "markdown", "id": "ef620d93", "metadata": {}, "source": [ "## 2. Titanic's MEC with *Random Forest*" ] }, { "cell_type": "code", "execution_count": null, "id": "f4dc7f42", "metadata": {}, "outputs": [], "source": [ "!brainome https://download.brainome.ai/data/public/titanic_train.csv -f RF -y -o predictor_204_RF.PY | grep MEC" ] }, { "cell_type": "markdown", "id": "8f889a13", "metadata": {}, "source": [ "## 3. Titanic's MEC with *Decision Tree*" ] }, { "cell_type": "code", "execution_count": null, "id": "2c4ef721", "metadata": {}, "outputs": [], "source": [ "!brainome https://download.brainome.ai/data/public/titanic_train.csv -f DT -y -o predictor_204_DT.PY | grep MEC" ] }, { "cell_type": "markdown", "id": "bcff1d1b", "metadata": {}, "source": [ "## 4. Titanic's MEC with *Neural Network*" ] }, { "cell_type": "code", "execution_count": null, "id": "8fa0bdd5", "metadata": {}, "outputs": [], "source": [ "!brainome https://download.brainome.ai/data/public/titanic_train.csv -f NN -y -o predictor_204_NN.PY | grep MEC" ] }, { "cell_type": "markdown", "id": "6a0b2595", "metadata": {}, "source": [ "## 5. Using MEC to pick the right model type\n", "Pick the model with the least MEC." ] }, { "cell_type": "markdown", "id": "9e36fb88", "metadata": {}, "source": [ "## Next Steps\n", "- Check out [brainome_205_Detecting_Data_Drift](./brainome_205_Detecting_Data_Drift.ipynb)" ] } ], "metadata": { "celltoolbar": "Edit Metadata", "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }