{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from polire.interpolate import *\n", "\n", "from polire.custom import CustomInterpolator\n", "import xgboost\n", "from sklearn.ensemble import RandomForestRegressor\n", "from sklearn.linear_model import LinearRegression\n", "from sklearn.neighbors import KNeighborsRegressor\n", "from sklearn.gaussian_process import GaussianProcessRegressor\n", "from sklearn.gaussian_process.kernels import Matern\n", "from sklearn.neural_network import MLPRegressor\n", "\n", "from sklearn.model_selection import train_test_split\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "from matplotlib import colors\n", "import seaborn as sns\n", "import sys" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv(\"../../daily_44201_2018.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | State Code | \n", "County Code | \n", "Site Num | \n", "Parameter Code | \n", "POC | \n", "Latitude | \n", "Longitude | \n", "Datum | \n", "Parameter Name | \n", "Sample Duration | \n", "... | \n", "AQI | \n", "Method Code | \n", "Method Name | \n", "Local Site Name | \n", "Address | \n", "State Name | \n", "County Name | \n", "City Name | \n", "CBSA Name | \n", "Date of Last Change | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "3 | \n", "10 | \n", "44201 | \n", "1 | \n", "30.497478 | \n", "-87.880258 | \n", "NAD83 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "21 | \n", "NaN | \n", "- | \n", "FAIRHOPE, Alabama | \n", "FAIRHOPE HIGH SCHOOL, 1 PIRATE DRIVE, FAIRHOPE... | \n", "Alabama | \n", "Baldwin | \n", "Fairhope | \n", "Daphne-Fairhope-Foley, AL | \n", "2019-02-12 | \n", "
1 | \n", "1 | \n", "3 | \n", "10 | \n", "44201 | \n", "1 | \n", "30.497478 | \n", "-87.880258 | \n", "NAD83 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "30 | \n", "NaN | \n", "- | \n", "FAIRHOPE, Alabama | \n", "FAIRHOPE HIGH SCHOOL, 1 PIRATE DRIVE, FAIRHOPE... | \n", "Alabama | \n", "Baldwin | \n", "Fairhope | \n", "Daphne-Fairhope-Foley, AL | \n", "2019-02-12 | \n", "
2 | \n", "1 | \n", "3 | \n", "10 | \n", "44201 | \n", "1 | \n", "30.497478 | \n", "-87.880258 | \n", "NAD83 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "41 | \n", "NaN | \n", "- | \n", "FAIRHOPE, Alabama | \n", "FAIRHOPE HIGH SCHOOL, 1 PIRATE DRIVE, FAIRHOPE... | \n", "Alabama | \n", "Baldwin | \n", "Fairhope | \n", "Daphne-Fairhope-Foley, AL | \n", "2019-02-12 | \n", "
3 rows × 29 columns
\n", "\n", " | State Code | \n", "County Code | \n", "Site Num | \n", "Parameter Code | \n", "POC | \n", "Latitude | \n", "Longitude | \n", "Datum | \n", "Parameter Name | \n", "Sample Duration | \n", "... | \n", "AQI | \n", "Method Code | \n", "Method Name | \n", "Local Site Name | \n", "Address | \n", "State Name | \n", "County Name | \n", "City Name | \n", "CBSA Name | \n", "Date of Last Change | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
292720 | \n", "39 | \n", "167 | \n", "4 | \n", "44201 | \n", "1 | \n", "39.432117 | \n", "-81.460443 | \n", "NAD83 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "58 | \n", "NaN | \n", "- | \n", "Marietta WTP | \n", "2000 4TH STREET | \n", "Ohio | \n", "Washington | \n", "Marietta | \n", "Marietta, OH | \n", "2019-01-29 | \n", "
399503 | \n", "56 | \n", "37 | \n", "77 | \n", "44201 | \n", "1 | \n", "41.158000 | \n", "-108.619000 | \n", "WGS84 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "67 | \n", "NaN | \n", "- | \n", "Hiawatha | \n", "Hiawatha Green Site | \n", "Wyoming | \n", "Sweetwater | \n", "Not in a city | \n", "Rock Springs, WY | \n", "2019-02-25 | \n", "
159073 | \n", "18 | \n", "167 | \n", "24 | \n", "44201 | \n", "1 | \n", "39.558525 | \n", "-87.312883 | \n", "NAD83 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "51 | \n", "NaN | \n", "- | \n", "Sandcut/ SITE LOCATED BY HOME BEHIND SHED. | \n", "7597 N. STEVENSON RD/ SANDCUT | \n", "Indiana | \n", "Vigo | \n", "Not in a city | \n", "Terre Haute, IN | \n", "2019-01-09 | \n", "
249423 | \n", "35 | \n", "13 | \n", "8 | \n", "44201 | \n", "2 | \n", "31.930659 | \n", "-106.631103 | \n", "WGS84 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "54 | \n", "NaN | \n", "- | \n", "6O La Union | \n", "7048 McNutt, La Union, NM | \n", "New Mexico | \n", "Dona Ana | \n", "Not in a city | \n", "Las Cruces, NM | \n", "2019-04-09 | \n", "
204274 | \n", "26 | \n", "81 | \n", "22 | \n", "44201 | \n", "1 | \n", "43.176672 | \n", "-85.416608 | \n", "WGS84 | \n", "Ozone | \n", "8-HR RUN AVG BEGIN HOUR | \n", "... | \n", "46 | \n", "NaN | \n", "- | \n", "APPROXIMATELY 1/4 MILE SOUTH OF 14 MILE RD | \n", "10300 14 MILE RD NE #B | \n", "Michigan | \n", "Kent | \n", "Not in a city | \n", "Grand Rapids-Wyoming, MI | \n", "2019-03-05 | \n", "
5 rows × 29 columns
\n", "