I wish to do a special type of scaling for my data.
Is it possible to query a database which has the following ints in a column:
10
5
5
3
1
1
0
1
5
2
2
And produce the following representation via a query:
1.0
0.8
0.8
0.6
0.2
0.2
0.0
1.0
0.8
0.4
0.4
So the max value becomes 1.0 and 0 remains as 0. Then we have the set of unique values excluding 0, which is 10, 5, 3, 2, 1. The length of this set is 5. The inverse is 0.2. Then the next largest value in our column, 5, become 1 – 0.2 = 0.8. Then the next largest value, 3, becomes 0.8-0.2 = 0.6, and so on.
10->1.0, 5->0.8, 3->0.6, 2->0.4, 1->0.2, 0->0
Or would you recommend that the programming language doing the query should instead perfom this scaling.
I’m the only one who will be quering the database and I haven’t chosen my database yet, but will be using one that is open-source or SQL-Server. This type is scaling is very important for my application and I will be using it on different tables. I will be programming in Python3.
EDIT:
SQL Server is also an option, as well as open source dbs
I would recommend PHP: