Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.
Machine learning focuses on the development of computer programs that can access data and use it learn for themselves.
Nowadays, machine learning are being used in various field ie. medical, IT, Industrial, space, etc.
Today we are focused on building a project based on polynomial regression to predict the room temperature.
Polynomial RegressionIn statistics,
polynomial regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modelled as an nth degree polynomial in x.
PredictionMachine learning is a way of identifying patterns in data and using them to automatically make predictions or decisions. ... For regression, you will learn how to measure the correlation between two variables and compute a best-fit line for making predictions when the underlying relationship is linear.
Hardware ConnectionIn the previous lesson, we have learned about LM35 Sensor. In this lesson, we will learn how to connect LM35 Sensor to Bolt.
Hardware Required- The Bolt Wifi module
- 3 female to male wire
- Temperature Sensor: LM35 sensor
Step 1: Hold the sensor in a manner such that you can read LM35 written on it.
Step 2: In this position, identify the pins of the sensor as VCC, Output and Gnd from your left to right.
In the above image, VCC is connected to the red wire, Output is connected to the orange wire and Gnd is connected to the brown wire.Step 3: Using male to female wire connect the 3 pins of the LM35 to the Bolt Wifi Module as follows:
- VCC pin of the LM35 connects to 5v of the Bolt Wifi module.
- Output pin of the LM35 connects to A0 (Analog input pin) of the Bolt Wifi module.
- Gnd pin of the LM35 connects to the Gnd.
The final circuit should look like the image below:
Step 1: Make the same connections as 'Hardware connections for temperature monitor' screen, in the 'Interfacing sensor over VPS' topic of the 'Cloud, API and Alerts' module.
Step 2: Power up the circuit and let it connect to the Bolt Cloud. (The Green LED of the Bolt should be on)
Step 3: Go to cloud.boltiot.com and create a new product. While creating the product, choose product type as Output Device and interface type as GPIO. After creating the product, select the recently created product and then click on configure icon.
Step 4: In the hardware tab, select the radio button next to the A0 pin. Give the pin the name 'temp' and save the configuration using the 'Save' icon.
Step 5: Move to the code tab, give the product code the name 'predict', and select the code type as js.
Step 6: Write the following code to plot the temperature data and run the polynomial regression algorithm on the data, and save the product configurations.
setChartLibrary('google-chart');setChartTitle('Polynomial Regression');setChartType('predictionGraph');setAxisName('time_stamp','temp');mul(0.0977);plotChart('time_stamp','temp');
Step 7: In the products tab, select the product created and then click on the link icon. Select your Bolt device in the popup and then click the 'Done' button.
Step 8: Click on 'deploy configuration' button and then the 'view this device' icon to view the page that you have designed. Below is the screenshot of the final output.
Step 9: Wait for about 2 hours for the device to upload enough data point to the Cloud. You can then click on the predict button to view the prediction graph based on polynomial regression algorithm.
Comments