{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# HW3: Task\n", "Predict the region and area (or areaname) of olive oils based on their fatty acid contents.source \n", "\n", "The task's source is http://www.ggobi.org/book/\n", "\n", "Fit and evaluate the classification predictions of LDA, LogisticRegression, SVM, k-NN, and \n", "Random Forests for both the region and area.\n", "\n", "### 20 pts for each classifier\n", "\n", "You may use the Classification Jupyter Notebook Dr. Kalpakis prepared for the class." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Dataset description and data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from IPython.display import IFrame\n", "IFrame(\"OliveOil2.pdf\", height=100, width=100, embed=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# The dataset\n", "df=pd.read_csv(\"olive.csv\")\n", "df.rename(columns={df.columns[0]:'areaname'}, inplace=True)\n", "df.areaname=df.areaname.map(lambda x: x.split('.')[-1])\n", "df.sample(50).head(10)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. LDA" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Logistic Regression" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. SVM" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. k-NN" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5. Random Forest" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "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.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }