Internet of Things
IOT data is one very important aspect of eCommerce. Climatic conditions, weather, festive seasons, events etc. often significantly impact business operations.
Sometimes, it may not be always possible to plan for unplanned catastrophic events, but whenever data is available in advance, it always help tremendously in planning and provide huge opportunity for growth in revenue, branding and building relationships with customer.
Purpose of this section is, to use, weather | climatic | planned events data to help detect "Seasonality" in SARIMA ML Models in AI predictive analytics. (SARIMA : seasonal auto regression integrated moving average time series machine learning model).
We will use standard weather and news information from weather.com and NEW API websites.
below are few example datasets gathered via getPiper IOT device located in Los Angeles CA
to support our analysis.
This section, assume, implanted IOT sensors or available API to capture vision, density, temperature, moisture, sound and activities.
not all IOT data mentioned below is used in our analysis.
events
using CSV, DataFrames
eventDF = DataFrame(CSV.File("../../assets/sampleData/eventCalendar.csv"))
first(eventDF[:, :], 10)
10 rows × 3 columns
CalendarDate | DayOfWeek | Event | |
---|---|---|---|
Date | String3 | String | |
1 | 0022-01-01 | SAT | New Year's Day |
2 | 0022-01-17 | MON | Martin Luther King Day |
3 | 0022-01-17 | MON | Civil Rights Day |
4 | 0022-01-17 | MON | Idaho Human Rights Day |
5 | 0022-01-19 | WED | Confederate Heroes' Day |
6 | 0022-01-27 | THU | International Holocaust Remembrance Day |
7 | 0022-02-01 | TUE | Black History Month |
8 | 0022-02-01 | TUE | Chinese New Year |
9 | 0022-02-14 | MON | Valentine's Day |
10 | 0022-02-14 | MON | Arizona Statehood Day |
holiday calendar
using CSV, DataFrames
calendarDF = DataFrame(CSV.File("../../assets/sampleData/calendar.csv"))
first(calendarDF[:, :], 10)
10 rows × 3 columns
HolidayDate | Event | DayOfWeek | |
---|---|---|---|
Date | String | String15 | |
1 | 2022-01-01 | New Year's Day | Saturday |
2 | 2022-01-17 | Martin Luther King Day | Monday |
3 | 2022-01-24 | Belly Laugh Day | Monday |
4 | 2022-02-02 | Groundhog Day | Wednesday |
5 | 2022-02-12 | Lincoln's Birthday | Saturday |
6 | 2022-02-14 | Valentine's Day | Monday |
7 | 2022-02-21 | Presidents Day and Washington's Birthday | Monday |
8 | 2022-03-01 | Mardi Gras Carnival | Tuesday |
9 | 2022-03-13 | Daylight Saving | Sunday |
10 | 2022-03-17 | St. Patrick's Day | Thursday |
temperature
Outside temperature
##############################################
# outdoorTemp
##############################################
using DataFrames, CSV, Dates, Distributions
sampleSize = 365
weatherDF = DataFrame(
recordDate = Date("2022-01-01", dateformat"y-m-d"):Day(1):(Date("2022-01-01", dateformat"y-m-d")+ Day(sampleSize-1)),
cityId = 1:1:sampleSize,
state = rand(["LA","LA","FL"], sampleSize),
indoorTemp = rand(64:1:94, sampleSize),
outdoorTemp = rand(54:1:104, sampleSize),
wind = rand(5:1:30, sampleSize),
humidity = rand(30:1:70, sampleSize),
precipitation = rand(0:1:5, sampleSize)
)
first(weatherDF[:, [:recordDate, :cityId, :state, :outdoorTemp]], 10)
10 rows × 4 columns
recordDate | cityId | state | outdoorTemp | |
---|---|---|---|---|
Date | Int64 | String | Int64 | |
1 | 2022-01-01 | 1 | FL | 54 |
2 | 2022-01-02 | 2 | LA | 68 |
3 | 2022-01-03 | 3 | LA | 100 |
4 | 2022-01-04 | 4 | LA | 67 |
5 | 2022-01-05 | 5 | FL | 99 |
6 | 2022-01-06 | 6 | LA | 72 |
7 | 2022-01-07 | 7 | LA | 93 |
8 | 2022-01-08 | 8 | LA | 77 |
9 | 2022-01-09 | 9 | LA | 64 |
10 | 2022-01-10 | 10 | FL | 94 |
Inside temperature
##############################################
# inside temperature
##############################################
using DataFrames, CSV, Dates, Distributions
sampleSize = 365
weatherDF = DataFrame(
recordDate = Date("2022-01-01", dateformat"y-m-d"):Day(1):(Date("2022-01-01", dateformat"y-m-d")+ Day(sampleSize-1)),
cityId = 1:1:sampleSize,
state = rand(["LA","LA","FL"], sampleSize),
indoorTemp = rand(64:1:94, sampleSize),
outdoorTemp = rand(54:1:104, sampleSize),
wind = rand(5:1:30, sampleSize),
humidity = rand(30:1:70, sampleSize),
precipitation = rand(0:1:5, sampleSize)
)
first(weatherDF[:, [:recordDate, :cityId, :state, :outdoorTemp]], 10)
10 rows × 4 columns
recordDate | cityId | state | outdoorTemp | |
---|---|---|---|---|
Date | Int64 | String | Int64 | |
1 | 2022-01-01 | 1 | FL | 89 |
2 | 2022-01-02 | 2 | LA | 74 |
3 | 2022-01-03 | 3 | FL | 88 |
4 | 2022-01-04 | 4 | LA | 74 |
5 | 2022-01-05 | 5 | LA | 84 |
6 | 2022-01-06 | 6 | FL | 93 |
7 | 2022-01-07 | 7 | LA | 64 |
8 | 2022-01-08 | 8 | LA | 76 |
9 | 2022-01-09 | 9 | FL | 58 |
10 | 2022-01-10 | 10 | FL | 103 |
moisture
##############################################
# moisture
##############################################
using DataFrames, CSV, Dates, Distributions
sampleSize = 365
weatherDF = DataFrame(
recordDate = Date("2022-01-01", dateformat"y-m-d"):Day(1):(Date("2022-01-01", dateformat"y-m-d")+ Day(sampleSize-1)),
cityId = 1:1:sampleSize,
state = rand(["LA","LA","FL"], sampleSize),
indoorTemp = rand(64:1:94, sampleSize),
outdoorTemp = rand(54:1:104, sampleSize),
wind = rand(5:1:30, sampleSize),
humidity = rand(30:1:70, sampleSize),
precipitation = rand(0:1:5, sampleSize)
)
first(weatherDF[:,[:recordDate,:cityId, :state, :humidity]], 10)
10 rows × 4 columns
recordDate | cityId | state | humidity | |
---|---|---|---|---|
Date | Int64 | String | Int64 | |
1 | 2022-01-01 | 1 | FL | 32 |
2 | 2022-01-02 | 2 | FL | 66 |
3 | 2022-01-03 | 3 | LA | 43 |
4 | 2022-01-04 | 4 | LA | 66 |
5 | 2022-01-05 | 5 | LA | 66 |
6 | 2022-01-06 | 6 | LA | 41 |
7 | 2022-01-07 | 7 | LA | 48 |
8 | 2022-01-08 | 8 | LA | 54 |
9 | 2022-01-09 | 9 | LA | 33 |
10 | 2022-01-10 | 10 | LA | 58 |
sound
##############################################
# Noise / sound
##############################################
using DataFrames, CSV, Dates, Distributions
sampleSize = 365
weatherDF = DataFrame(
recordDate = Date("2022-01-01", dateformat"y-m-d"):Day(1):(Date("2022-01-01", dateformat"y-m-d")+ Day(sampleSize-1)),
cityId = 1:1:sampleSize,
state = rand(["LA","LA","FL"], sampleSize),
indoorTemp = rand(64:1:94, sampleSize),
sound = rand(54:1:104, sampleSize),
wind = rand(5:1:30, sampleSize),
humidity = rand(30:1:70, sampleSize),
precipitation = rand(0:1:5, sampleSize)
)
first(weatherDF[:,[:recordDate,:cityId, :state, :sound]], 10)
10 rows × 4 columns
recordDate | cityId | state | sound | |
---|---|---|---|---|
Date | Int64 | String | Int64 | |
1 | 2022-01-01 | 1 | FL | 62 |
2 | 2022-01-02 | 2 | FL | 80 |
3 | 2022-01-03 | 3 | FL | 86 |
4 | 2022-01-04 | 4 | LA | 68 |
5 | 2022-01-05 | 5 | LA | 55 |
6 | 2022-01-06 | 6 | LA | 104 |
7 | 2022-01-07 | 7 | FL | 103 |
8 | 2022-01-08 | 8 | LA | 94 |
9 | 2022-01-09 | 9 | LA | 94 |
10 | 2022-01-10 | 10 | FL | 68 |
activities
motion activities
##############################################
# motion activities
##############################################
using DataFrames, CSV, Dates, Distributions
sampleSize = 365
weatherDF = DataFrame(
recordDate = Date("2022-01-01", dateformat"y-m-d"):Day(1):(Date("2022-01-01", dateformat"y-m-d")+ Day(sampleSize-1)),
cityId = 1:1:sampleSize,
state = rand(["LA","LA","FL"], sampleSize),
indoorTemp = rand(64:1:94, sampleSize),
sound = rand(54:1:104, sampleSize),
shadows = rand(5:1:30, sampleSize),
humidity = rand(30:1:70, sampleSize),
precipitation = rand(0:1:5, sampleSize)
)
first(weatherDF[:,[:recordDate, :cityId, :state, :shadows]], 10)
10 rows × 4 columns
recordDate | cityId | state | shadows | |
---|---|---|---|---|
Date | Int64 | String | Int64 | |
1 | 2022-01-01 | 1 | FL | 30 |
2 | 2022-01-02 | 2 | LA | 6 |
3 | 2022-01-03 | 3 | FL | 29 |
4 | 2022-01-04 | 4 | FL | 23 |
5 | 2022-01-05 | 5 | FL | 14 |
6 | 2022-01-06 | 6 | FL | 16 |
7 | 2022-01-07 | 7 | FL | 12 |
8 | 2022-01-08 | 8 | LA | 17 |
9 | 2022-01-09 | 9 | LA | 10 |
10 | 2022-01-10 | 10 | LA | 25 |
density / vision
Capturing crowd density varies case by case. For example, In case of, organized gatherings like Theme parks, concerts etc. number of people attending the event can be predicted in advance.
However, at the same, number of people entering, leaving and present at a given time is very important. Most of the chaos, happens when too many people appear at a place at the same time. for example, people entering / leaving premises.
other option is, Density will calculated using vision AI, captured through a motion camera / CCTV footage.
visibility
Brightness