# Machine Learning in Elixir: query on normalising data between 0..1 (page 5)

**URL:** <https://forum.devtalk.com/t/machine-learning-in-elixir-query-on-normalising-data-between-0-1-page-5/118011>\
**Category:** PragProg Customers\
**Tags:** book-machine-learning-in-elixir, errata\
**Created:** [26 July 2023 21:57 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-query-on-normalising-data-between-0-1-page-5/118011 "2023-07-26T21:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris660](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@Chris660](https://forum.devtalk.com/u/Chris660)\
**Post date:** [26 July 2023 21:57 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-query-on-normalising-data-between-0-1-page-5/118011/1 "2023-07-26T21:57:50Z")

</div>

This didn’t seem right to me:

> For instance, you can squeeze the values of a feature between 0 and 1 by dividing every individual feature by the max value of that feature column and then subtracting by the min value.

To ensure the whole 0…1 range is used, don’t you want to first subtract the minimum value in the column (baseline to 0), then divide by the _resulting_ maximum value?

Effectively:

```
normalised = (value - min) / (max - min)

```

---

<div class="post-metadata">

**Author:** ![seanmor5](https://forum.devtalk.com/user_avatar/forum.devtalk.com/seanmor5/32/1169_2.png) [@seanmor5](https://forum.devtalk.com/u/seanmor5)\
**Post date:** [28 July 2023 13:39 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-query-on-normalising-data-between-0-1-page-5/118011/2 "2023-07-28T13:39:05Z")

</div>

The wording is incorrect in the book. It’s supposed to be min-max scaling which matches the equation you’ve written. I’ve marked it to get updated 🙂
