Min Max is a data normalization technique like Z score, decimal scaling, and normalization with standard deviation. It helps to normalize the data. It will scale the data between 0 and 1. This normalization helps us to understand the data easily.
For example, if I say you to tell me the difference between 200 and 1000 then it’s a little bit confusing as compared to when I ask you to tell me the difference between 0.2 and 1.
Min Max normalization formula
marks |
8 |
10 |
15 |
20Â Â |
Min:
The minimum value of the given attribute. Here Min is 8
Max:
The maximum value of the given attribute. Here Max is 20
V: V is the respective value of the attribute. For example here V1=8, V2=10, V3=15, and V4=20
newMax:
1
newMin:
0

marks |
marks after Min-Max normalization |
8 | 0 |
10 | 0.16 |
15 | 0.58 |
20 | 1 |
Min max normalization example
Download Excel File Calculations
Comparison of Min-Max Normalization and Z-Score Normalization
Let’s see the comparison of Min-Max Normalization and Z-Score Normalization
Min-max normalization | Z-score normalization |
Not very well efficient in handling the outliers | Handles the outliers in a good way. |
Min-max Guarantees that all the features will have the exact same scale. | Helpful in the normalization of the data but not with the exact same scale. |
Implementation of Min-Max normalization in C++
- Calculate and show the maximum value from the array.
- Calculate and show the minimum value from the array.
- Calculate and show the average value from the array, and the number of values that are larger than the average.
- Calculate and show the normalized values of the original array values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
#include <stdio.h> int Maximum_Value( double MinMaxArray[], int num_elements) // This function will calculate and show the maximum value from the array { int i, max=-32000; for (i=0; i<num_elements; i++) { if (MinMaxArray[i]>max) { max=MinMaxArray[i]; } } return(max); } int MinValue( double MinMaxArray[], int num_elements) // This function will calculate and show the minimum value from the array { int i, min=0; for (i=0; i<num_elements; i++) { if (i==0) min=MinMaxArray[i]; else if (MinMaxArray[i]<min) min=MinMaxArray[i]; } return(min); } double averageX(double MinMaxArray[], int num_elements) //This function will calculate and show the average value from the array, and the number of values that are // larger then the average { float average; int i, sum=0, valuesAboveAverage=0; for (i=0; i<num_elements; i++) { sum+=MinMaxArray[i]; average=sum/num_elements; if (MinMaxArray[i]>average) valuesAboveAverage++; } printf(" Values above the average are: %d\n", valuesAboveAverage); printf("Average: %f\n", average); return(average); } void norm_1D(int min, int max, int average, double MinMaxArray[], int num_elements) // This function will calculate and show the normalized values of the original // array values { int i; double normalizedVal[10]; for (i=1; i<num_elements; i++) { normalizedVal[i]=(MinMaxArray[i]-min) / (max-min); } for
(i=0; i<10; i++) printf("Normalized Values are ? %5.2f\n", normalizedVal[i]); } int main(void) { double MinMaxArray[10] = {1, 0, 5, 9, 8, 3, 2 int max, min; double average; max = Maximum_Value(MinMaxArray, 10); min = MinValue(MinMaxArray, 10); average = averageX(MinMaxArray, 10); norm_1D(min, max, average, MinMaxArray, 10); printf("The min value is %d\n", min); printf("The max value is %d\n", max); return(0); } |
Output
Example of Min-max scaling in data mining:Â
Min-max normalization detail is available in the previous tutorial.
Here, There is just another example of the practice.
Min Max Normalization in Python and Matlab
Min-Max normalization is explained very briefly in the next tutorial.
Video Lecture
FAQ
min-max normalization python. min-max normalization in r. min max normalization pandas
min max normalization excel. min-max normalization vs standardization. min-max normalization matlab. use min-max normalization to transform the value 35 for age on the range.