Machine Learning Projects - Machine Learning Applications
Problem: Many techniques and tools have been developed for measuring temperature in these decades. Some techniques are the Silicon diode method, Biometalic device, Change of state of a sensor, etc. Mentionables that, those methods are costly. A cricket's chirping (Cricket Chirps is one type of insect) can be used to approximate the temperature in Fahrenheit or in Degree Celsius. It is a simple and inexpensive way to predict the temperature using Cricket Chirps.
Dataset: Dataset has been made from real-life observation. The dataset is collected from the web and prepare the dataset for this mini-project.
Programming Language: For the implementation of this problem, we will use the Python language. Also, we will use python's sklearn (scikit learn) packages library for using a linear model.
Solution steps:
- Pre-process the dataset (using python-pandas package).
- Split the dataset for train and test samples (using python-ScikitLearn package).
- Apply Linear Regression model (a built-in scikit learn model) on the dataset.
- Test the model with a new dataset's sample.
Sample output: For 17 chirps/sec, The temperature is: 27.0 degrees celsius
Code:
----------------start------------#importing python package
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sklearn
Outputs for the print function:
#Table view of the Dataset
print(dataset)
Chirps/Sec Temperature(dC)
0 20.000000 31.444444
1 16.000000 21.999999
2 19.799999 34.055557
3 18.400000 29.055557
4 17.100000 26.999999
5 15.500000 23.999998
6 14.700000 20.944443
7 17.100000 27.777800
8 15.400000 20.777779
9 16.200001 28.500002
10 15.000000 26.444444
11 17.200001 28.111110
12 16.000000 26.999999
13 17.000000 28.611110
14 14.400000 24.611113
print('For ',x_new[0][0], ' chirps/sec, The
temperature is : ',round(y_pred_new[0][0]), ' degree celsius')
For 17 chirps/sec, The temperature is : 27 degree celsius