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

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

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.

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()))

Relevant Projects

Census Income Data Set Project - Predict Adult Census Income
Use the Adult Income dataset to predict whether income exceeds 50K yr based on census data.

Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

NLP and Deep Learning For Fake News Classification in Python
In this project you will use Python to implement various machine learning methods( RNN, LSTM, GRU) for fake news classification.

Time Series Python Project using Greykite and Neural Prophet
In this time series project, you will forecast Walmart sales over time using the powerful, fast, and flexible time series forecasting library Greykite that helps automate time series problems.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

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.

Machine Learning project for Retail Price Optimization
In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

Data Science Project-TalkingData AdTracking Fraud Detection
Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

Classification of T shirt images to see if they have text on them
Want to search images of clothes which have text on them? Then this project talks through how we can classify an image whether it has text on it or not. For this we use state of the model called as inception and try and deepdive into how it works on our dataset

PySpark Tutorial - Learn to use Apache Spark with Python
PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.