{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Logistic Regression - Lesson 4\n", "\n", "Load up required libraries and dataset. Convert the data to a dataframe containing a subset of the data:" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | City Name | \n", "Type | \n", "Package | \n", "Variety | \n", "Sub Variety | \n", "Grade | \n", "Date | \n", "Low Price | \n", "High Price | \n", "Mostly Low | \n", "... | \n", "Unit of Sale | \n", "Quality | \n", "Condition | \n", "Appearance | \n", "Storage | \n", "Crop | \n", "Repack | \n", "Trans Mode | \n", "Unnamed: 24 | \n", "Unnamed: 25 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "BALTIMORE | \n", "NaN | \n", "24 inch bins | \n", "NaN | \n", "NaN | \n", "NaN | \n", "4/29/17 | \n", "270.0 | \n", "280.0 | \n", "270.0 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "E | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
1 | \n", "BALTIMORE | \n", "NaN | \n", "24 inch bins | \n", "NaN | \n", "NaN | \n", "NaN | \n", "5/6/17 | \n", "270.0 | \n", "280.0 | \n", "270.0 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "E | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
2 | \n", "BALTIMORE | \n", "NaN | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "NaN | \n", "NaN | \n", "9/24/16 | \n", "160.0 | \n", "160.0 | \n", "160.0 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "N | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
3 | \n", "BALTIMORE | \n", "NaN | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "NaN | \n", "NaN | \n", "9/24/16 | \n", "160.0 | \n", "160.0 | \n", "160.0 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "N | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
4 | \n", "BALTIMORE | \n", "NaN | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "NaN | \n", "NaN | \n", "11/5/16 | \n", "90.0 | \n", "100.0 | \n", "90.0 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "N | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
5 rows × 26 columns
\n", "\n", " | City Name | \n", "Package | \n", "Variety | \n", "Origin | \n", "Item Size | \n", "Color | \n", "
---|---|---|---|---|---|---|
2 | \n", "BALTIMORE | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "DELAWARE | \n", "med | \n", "ORANGE | \n", "
3 | \n", "BALTIMORE | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "VIRGINIA | \n", "med | \n", "ORANGE | \n", "
4 | \n", "BALTIMORE | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "MARYLAND | \n", "lge | \n", "ORANGE | \n", "
5 | \n", "BALTIMORE | \n", "24 inch bins | \n", "HOWDEN TYPE | \n", "MARYLAND | \n", "lge | \n", "ORANGE | \n", "
6 | \n", "BALTIMORE | \n", "36 inch bins | \n", "HOWDEN TYPE | \n", "MARYLAND | \n", "med | \n", "ORANGE | \n", "
\n", " | ord__Item Size | \n", "cat__City Name_ATLANTA | \n", "cat__City Name_BALTIMORE | \n", "cat__City Name_BOSTON | \n", "cat__City Name_CHICAGO | \n", "cat__City Name_COLUMBIA | \n", "cat__City Name_DALLAS | \n", "cat__City Name_DETROIT | \n", "cat__City Name_LOS ANGELES | \n", "cat__City Name_MIAMI | \n", "... | \n", "cat__Origin_MICHIGAN | \n", "cat__Origin_NEW JERSEY | \n", "cat__Origin_NEW YORK | \n", "cat__Origin_NORTH CAROLINA | \n", "cat__Origin_OHIO | \n", "cat__Origin_PENNSYLVANIA | \n", "cat__Origin_TENNESSEE | \n", "cat__Origin_TEXAS | \n", "cat__Origin_VERMONT | \n", "cat__Origin_VIRGINIA | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
3 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "
4 | \n", "3.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
5 | \n", "3.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
6 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
5 rows × 48 columns
\n", "\n", " | ord__Item Size | \n", "cat__City Name_ATLANTA | \n", "cat__City Name_BALTIMORE | \n", "cat__City Name_BOSTON | \n", "cat__City Name_CHICAGO | \n", "cat__City Name_COLUMBIA | \n", "cat__City Name_DALLAS | \n", "cat__City Name_DETROIT | \n", "cat__City Name_LOS ANGELES | \n", "cat__City Name_MIAMI | \n", "... | \n", "cat__Origin_NEW JERSEY | \n", "cat__Origin_NEW YORK | \n", "cat__Origin_NORTH CAROLINA | \n", "cat__Origin_OHIO | \n", "cat__Origin_PENNSYLVANIA | \n", "cat__Origin_TENNESSEE | \n", "cat__Origin_TEXAS | \n", "cat__Origin_VERMONT | \n", "cat__Origin_VIRGINIA | \n", "Color | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0 | \n", "
3 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "0 | \n", "
4 | \n", "3.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0 | \n", "
5 | \n", "3.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0 | \n", "
6 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0 | \n", "
5 rows × 49 columns
\n", "