How to standardise features in Python?
DATA MUNGING

How to standardise features in Python?

How to standardise features in Python?

This recipe helps you standardise features in Python

0
This python source code does the following: 1. Implements Standard Scaler function. 2. Creates your own numpy feature matrix. 3. Imports necessary modules and libraries from sklearn.
In [1]:
## How to standardise features in Python 
def Kickstarter_Example_40():
    print()
    print(format('How to standardise features in Python', '*^82'))
    import warnings
    warnings.filterwarnings("ignore")

    # Load libraries
    from sklearn import preprocessing
    import numpy as np

    # Create feature
    x = np.array([[-500.5],
                  [-100.1],
                  [0],
                  [100.1],
                  [900.9]])

    # Standardize Feature
    # Create scaler
    scaler = preprocessing.StandardScaler()

    # Transform the feature
    standardized_x = scaler.fit_transform(x)

    # Show feature
    print(); print(x)
    print(); print(standardized_x)

Kickstarter_Example_40()
**********************How to standardise features in Python***********************

[[-500.5]
 [-100.1]
 [   0. ]
 [ 100.1]
 [ 900.9]]

[[-1.26687088]
 [-0.39316683]
 [-0.17474081]
 [ 0.0436852 ]
 [ 1.79109332]]

Relevant Projects

Perform Time series modelling using Facebook Prophet
In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.

Identifying Product Bundles from Sales Data Using R Language
In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

Data Science Project-All State Insurance Claims Severity Prediction
Data science project in R to develop automated methods for predicting the cost and severity of insurance claims.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Deep Learning with Keras in R to Predict Customer Churn
In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Predict Employee Computer Access Needs in Python
Data Science Project in Python- Given his or her job role, predict employee access needs using amazon employee database.

Machine Learning or Predictive Models in IoT - Energy Prediction Use Case
In this machine learning and IoT project, we are going to test out the experimental data using various predictive models and train the models and break the energy usage.

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.