## Decimal scalingÂ with Examples

Decimal scalingÂ is a data normalization technique like Z score, Min-Max,Â and normalization with standard deviation. Decimal scaling is a data normalization technique. In this technique, we move the decimal point of values of the attribute. This movement of decimal points totally depends on the maximum value among all values in the attribute.

## Decimal Scaling Formula

A value v of attribute A is can be normalized by the following formula

Normalized value of attribute Â = **( v ^{i} / 10^{j} )**

If you are interested in an excel file of decimal scaling, then you can read the excel file with calculations.

## Example ofÂ Decimal scalingÂ :

CGPA |
Formula |
CGPA Normalized after Decimal scaling |

2 | 2/10 | 0.2 |

3 | 3/10 | 0.3 |

We will check the maximum value among our attribute CGPA. Here maximum value is 3 so we can convert it to a decimal by dividing by 10. Why 10?

we will count total numbers in our maximum value and then put 1 and after 1 we can put zeros equal to the length of the maximum value.

Here 3 is the maximum value and the total numbers in this value are only 1. so we will put one zero after one.

**Example 2:**

Salary bonus |
Formula |
CGPA Normalized after Decimal scaling |

400 | 400 / 1000 | 0.4 |

310 | 310 / 1000 | 0.31 |

We will check the maximum value of our attribute “**salary bonus**“. Here maximum value is 400 so we can convert it into a decimal by dividing it by 1000. Why 1000?

400 contains three digits and we so we can put three zeros after 1. So, it looks like 1000.

**Example 3:**

SalaryÂ |
Formula |
CGPA Normalized after Decimal scaling |

40,000 | 40,000 / 100000 | 0.4 |

31, 000 | 31,000 / 100000 | 0.31 |

## Decimal Scaling C++ Example

Suppose we have a number 400, and want to normalize this number with decimal scaling.

1 2 3 4 5 6 7 8 9 |
#include<iostream> using namespace std; int main() { float n=400; cout<<"number is"<<n<<endl; float decimalScaling = n/1000; cout<<"number is converted to its decimal and the result is:"<<decimalScaling<<endl; } |

## Download Helping Material for Decimal Scaling (Just for non-commercial Use)

- PDF file including Decimal Scaling.
- Slides Presentation including Decimal Scaling.
- Excel File Calculations including Decimal Scaling.

## Decimal scaling in R

**Decscale function for Decimal Scaling:**

Decscale is a function to apply decimal scaling to a matrix or data-frame. Decimal scaling transforms the data into [-1,1] by finding k such that the absolute value of the maximum value of each attribute divided by 10\^k is <= 1.

*How to use Decscale function?*

decscale(data)

The dataset to be scaled is considered as a Arguments

**Note:** Uses the scale function found in the R base package.

**Decdata:** The original matrix that has been scaled by decimal scaling