Predicting fuel efficiency of cars.
Experience nocoding AI
In this blog, we will implement the tutorial provided by TensorFlow as nocoding AI.
You can always refer to the original tutorial of TensorFlow.
Introduction
This tutorial trains a model that predicts the fuel consumption of a car. More precisely how many miles per gallon when “horsepower” of a car is given through small datasets and simple model structures.
To this end, we will go through the following steps:
- Load the original data required for training.
- The loaded data is processed and normalized to fit the model through a data preprocessor.
- Define the architecture of the model.
- Monitor performance during model training.
With nocoding AI, you will learn:
- How to preprocess data.
- How to define an AI Model Architecture. (just a fancy way to say which function run when your model is executing).
- How to infer using trained models.
- A method of normalizing input data required for inference and inverse normalizing the inference result value.
What you need:
- The latest version of Chrome or any other recent browser.
- You should be familiar with the basics of nocoding AI.
If you need to know more, please refer to the Nocoding AI “Getting Started Guide”.
LET’S GET READY !
Connecting to nocoding AI.
Go to nocoding AI and log in. If you don’t have an account, you have to sign up as a member.
Preparing for a new app.
First of all, you need to create a new app.
Click App Builder in the left menu and them Create New in the project screen.
At this page, fill the blank Title with “Fuel Prediction Project” and Descriptions with “project to predict fuel efficiency of automobiles”. Then, click on Create empty.
Success ! Continue.
Download and modify CSV data
Now, it is time to upload your data. Clean on Data Cleaner on the left side bar. Then, click on Create New.
On the Create Dataset screen, fill the Dataset Name with (for instance) Fuel Efficiency dataset. A short explanation will do for the description blank. Be sure to select the Data type as CSV.
You can now see the block “Fuel Efficiency dataset”. Click on Use sample.
Success ! You have created your dataset.
Now open it. You will now access all the data and choose to display it in 10,30,50 or even 500 rows.
Tick the Remove Null and click on the button select. You will access the following screen:
As shown, tick Miles_per_Gallon and Horsepower.
Do the same for Normalize.
Here you are:
Click on the disquette icon to save your work (near the arrows in the upper bar).
Step 2. Check !
Create a Model Architecture
Now, let us build our Model Architecture. But what does Model Architecture mean by the way ? Model Architecture is just a fancy way to describe which algorithm your model will use to compute its answer. Simple as that. Click the Open button of the original data node.
Click on Model Designer on the left side bar and on Create New.
Fill the Model Name and Description blanks and click on Create empty button inside the Empty Model block.
Success ! Continue.
On the following screen, click on Datasets to access My Datasets and click on Fuel efficiency dataset.
a Fuel efficiency dataset block will appear.
Next the tab Dataset, click on Layers.
Click on Bookmarks until the arrow on the left faces upward. Image Classification column will appear and the elements below will change.
Drag and drop input, output as well as two blocks of Dense and link them with the nodes in the same order as the screenshot below:
Preparing for training.
Your model must be ‘compiled’ before training. Let’s take a look at the settings:
Now it’s time to enter values:
First, enter 1 in the Input Layer, in the shape bar.
For the Dense blocks, click on the Advanced buttons of each layer and enter 1 in the units bars. Also make sure to tick the box next to use Bias, as you can see in the red rectangles in the picture below.
Now click on the button Start Training in the upper right of the picture .
Fill the parameters as on the picture below:
- Input and Output Type should be setup as TEXT.
- Optimizer must be ADAM. An Optimizer is an Algorithm optimizing the model.
- loss must be defined as meanSquaredError. The loss function determines whether the model is being trained well during the model training process.
- metrics must be mse.
- epochs and batch size should be defined as 50 and 32 respectively. (nb: Epochs are the number of actual training sessions. Batch size is a value that determines how many pieces of data to group. )
- Now, tick Miles per Gallon and Horsepower in the xColumns and yColumns respectively.
- Finally, tick Use GPU for more speed.
OK ! Success !
You can check the progress by clicking on Training Results and Training Graph.
Now let us go back to App Builder and open your app.
Click on Element, it’s time to drag&drop!
Select Input (Text) in Input methods, and drop it onto the Empty Screen. Do the same with Output (image).
You should get something like this:
You can also edit your app by drag and dropping the nodes Title and Text onto the screen and change the parameters you want.
Then, click on AI Models below Output. Your Model Detail will appear on the right of the screen: