Hello guys, today I want to introduce to you what is Percentile in Machine Learning so that you can better understand these concepts and apply it better in practice =)) I think the opening note is also good. quite a word already. Well, I don’t like to write much because I don’t have much words =)) Now let’s start. Let’s go!!
1. What are Percentiles?
Percentiles is a number that describes a certain percentage value of values lower than it.
Reading the definition, perhaps many of you are still confused? Now let’s go directly to the example to make it easier to understand!
Example 1: Suppose we have a series of cakes from all 21 shops sold in a day in a county
1 2 3 4 5 6 7 8 9 | #Sử dụng phương pháp NumPy percentile()để tìm các phân vị: import numpy #Danh sách số lượng bánh bán ra trong 1 ngày của 21 cửa hàng trong 1 quận cakes = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31] x = numpy.percentile(cakes, 75) print(x) |
Result: 43.0
The above result tells us that 75% of the shops have the number of cakes sold in a day less than 43 or in other words the number 43 is greater than 75% of the value contained in the list of cakes sold in a day. of 21 stores.
Write here, I don’t know if you understand yet =)) If you don’t understand, continue with Example 2 below. Similar to Example 1, but I write in a different wording.
Example 2: Similar to Example 1, We want to find the value at which it is greater than 85% of the shops with the number of cakes sold in 1 day
1 2 3 4 5 6 | import numpy cakes = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31] x = numpy.percentile(cakes, 85) print(x) |
Result: 50.0
Done that
Bye, see you soon!