in Machine Learning by
Q:

What is Rescaling of data and how is it done?

1 Answer

0 votes
by
In real-world scenarios, the attributes present in data will be in a varying pattern. So, rescaling of the characteristics to a common scale gives benefit to algorithms to process the data efficiently.

We can rescale the data using Scikit-learn. The code for rescaling the data using MinMaxScaler is as follows:

#Rescaling data

import pandas

import scipy

import numpy

from sklearn.preprocessing import MinMaxScaler

names = ['Abhi', 'Piyush', 'Pranay', 'Sourav', 'Sid', 'Mike', 'pedi', 'Jack', 'Tim']

Dataframe = pandas.read_csv(url, names=names)

Array = dataframe.values

# Splitting the array into input and output

X = array[:,0:8]

Y = array[:,8]

Scaler = MinMaxScaler(feature_range=(0, 1))

rescaledX = scaler.fit_transform(X)

# Summarizing the modified data

numpy.set_printoptions(precision=3)

print(rescaledX[0:5,:])
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

+1 vote
asked Jul 13, 2019 in Regression Analysis by anonymous
0 votes
asked Nov 29, 2019 in Machine Learning by SakshiSharma
0 votes
asked May 14, 2019 in Machine Learning by Derya
0 votes
asked Nov 29, 2019 in Machine Learning by SakshiSharma
0 votes
asked Jun 8, 2020 in HDFS by Robindeniel
...