Page 290 - AI_Ver_3.0_class_11
P. 290

Inspection Method
                                 MODE (Individual Series):                       Inspection
                                                                                   Method
                                   Marks    Marks
                                     2        2
                                                     Two times
                                     5        2
                                     7        3      One time
                                                                   Arrange the data in ascending order
                                     5        5
                                     6        5      Three times
                                     2        5                    On inspection of the data it is clear
                                                                   that the value ‘7’ occurs maximum
                                     5        6                    number of times in the series i.e. 4
                                                     One time
                                     7        7                    times
                                     3        7
                                                                   Hence, Mode = 7
                                     7        7      Four times
                                     7        7



              Mode calculation using Python
              Program 3: To calculate the mode of 25 students weight.
              50.5, 55.2, 60.3, 65.8, 70.1, 75.6, 80.4, 85.7, 90.2, 95.5, 50.3, 55.8, 60.1, 65.4, 70.9, 75.2, 80.6, 85.3, 90.8,
              95.1,50.7, 55.9, 60.5, 65.2, 70.4


              import statistics

              # New list of weights for 25 students (with mode intentionally set to 60.5)
              weights = [50.5, 55.2, 60.3, 65.8, 70.1, 75.6, 80.4, 85.7, 90.2, 95.5,
                         50.3, 55.8, 60.5, 65.4, 70.9, 75.2, 80.6, 85.3, 90.8, 95.1,
                         50.7, 55.9, 60.5, 65.2, 70.4]

              # Calculate the mode weight using statistics.mode()
              mode_weight = statistics.mode(weights)


              # Print the mode weight
              print("Mode weight of 25 students is:", mode_weight)

              Output:

              Mode weight of 25 students is: 60.5
              When to use mean, median and mode:

                                Mean                           Median                          Mode

                    Data is Normally Distributed:  Skewed Data: The median is  Categorical Data: The mode is
                    The mean is informative when  better than the mean for skewed  the only measure that can be used
                    data follows a normal distribution,  distributions  because  it  is  not  for categorical (nominal) data,
                    as  it  provides  a  good  central  affected by extreme values.  indicating  the most common
                    point.                                                         category.


                    288     Touchpad Artificial Intelligence (Ver. 3.0)-XI
   285   286   287   288   289   290   291   292   293   294   295