in Machine Learning by (31.6k points)

What is Rescaling of data and how is it done?

1 Answer

0 votes
by (20.8k points)
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



Related questions

+1 vote
asked Sep 30, 2021 in Machine Learning by Robin (14.5k points)