- Business & Data Research
- Posts
- Smoke Detection - ML Model Chapter 1
Smoke Detection - ML Model Chapter 1
Data Slicing - Correlation
Smoke Detection using ML Model - Data Partition and Slicing
Business Case : Identify the data correlation using Machine Learning model through Caret package.
Key insights and takeaway :
Small positive correlation between target feature and Humidity, Pressure. Small negative correlation between the target feature and TVOC, Raw Ethanol.
High positive correlation between eCO2 and TVOC, PM1.0. Pressure and Humidity. Raw H2 and Raw Ethanol. PM1.0 and eCO2, PM2.5.
library(caret)
library(kernlab)
install.packages("rpart.plot")
library(rpart.plot)
install.packages("corrplot")
library(corrplot)
install.packages("ggcorrplot")
library(ggcorrplot)
# file.choose()
smoke = read.csv("YYYYYYY”
header = TRUE)
install.packages("psych")
library(psych)
View(smoke)
library(dplyr)
library(tidyverse)
smoke %>%
select(
temp_c = Temperature.C.,
humidity = Humidity...,
tvoc = TVOC.ppb.,
co2 = eCO2.ppm.,
h2 = Raw.H2,
ethanol = Raw.Ethanol,
pressure = Pressure.hPa.,
pm1 = PM1.0,
pm2_5 = PM2.5,
fire_alarm = Fire.Alarm
) %>%
mutate(
fire_alarm = factor(fire_alarm, levels = c(1,0), labels = c("yes","no"))
) %>%
glimpse() -> df_data
cor(df_data)
ggplot(df_data, aes(x = df_data$temp_c, y = df_data$pressure)) + geom_point()
install.packages("corrplot")
library(corrplot)
corrplot(corr = cor(df_data[,1:7]))