Explain with an example how to do feature preprocessing using keras?

This recipe explains with an example how to do feature preprocessing using keras

Recipe Objective

With an example, elaborate how to do feature preprocessing using keras

The Keras preprocessing layers API gives an option to developers to build Keras-native input processing pipelines. These pipelines can be used as independent preprocessing code in non-Keras workflows, they can be combined directly with Keras models.

Learn to Build a Multi Class Image Classification Model in Python from Scratch

Step 1- Importing Library

import numpy as np import tensorflow as tf from tensorflow.keras.layers.experimental import preprocessing

Step 2- Creating a 2d array.

Preprocessing a 2D array.

X = np.array([[4,8,10], [40,100, 120], [200, 300, 1000],[1000,5000,10000]]) layer = preprocessing.Normalization() layer.adapt(data) normalized_X = layer(X)

Step 3- Printing the mean and Standard Deviation of Data.

print("Features mean: %.2f" % (normalized_X.numpy().mean())) print("Features std: %.2f" % (normalized_X.numpy().std()))

What Users are saying..

profile image

Ameeruddin Mohammed

ETL (Abintio) developer at IBM
linkedin profile url

I come from a background in Marketing and Analytics and when I developed an interest in Machine Learning algorithms, I did multiple in-class courses from reputed institutions though I got good... Read More

Relevant Projects

Build a Churn Prediction Model using Ensemble Learning
Learn how to build ensemble machine learning models like Random Forest, Adaboost, and Gradient Boosting for Customer Churn Prediction using Python

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

ML Model Deployment on AWS for Customer Churn Prediction
MLOps Project-Deploy Machine Learning Model to Production Python on AWS for Customer Churn Prediction

AWS MLOps Project to Deploy a Classification Model [Banking]
In this AWS MLOps project, you will learn how to deploy a classification model using Flask on AWS.

Insurance Pricing Forecast Using XGBoost Regressor
In this project, we are going to talk about insurance forecast by using linear and xgboost regression techniques.

Forecasting Business KPI's with Tensorflow and Python
In this machine learning project, you will use the video clip of an IPL match played between CSK and RCB to forecast key performance indicators like the number of appearances of a brand logo, the frames, and the shortest and longest area percentage in the video.

Deploy Transformer BART Model for Text summarization on GCP
Learn to Deploy a Machine Learning Model for the Abstractive Text Summarization on Google Cloud Platform (GCP)

Learn How to Build PyTorch Neural Networks from Scratch
In this deep learning project, you will learn how to build PyTorch neural networks from scratch.

Build CI/CD Pipeline for Machine Learning Projects using Jenkins
In this project, you will learn how to create a CI/CD pipeline for a search engine application using Jenkins.

Learn How to Build a Logistic Regression Model in PyTorch
In this Machine Learning Project, you will learn how to build a simple logistic regression model in PyTorch for customer churn prediction.

OSZAR »