पॉइंट एस्टिमेट्स की सापेक्ष त्रुटि

Python में Sampling

James Chapman

Curriculum Manager, DataCamp

सैंपल साइज = पंक्तियों की संख्या

len(coffee_ratings.sample(n=300))
300
len(coffee_ratings.sample(frac=0.25))
334
Python में Sampling

विभिन्न सैंपल साइज

coffee_ratings['total_cup_points'].mean()
82.15120328849028
coffee_ratings.sample(n=10)['total_cup_points'].mean()
83.027
coffee_ratings.sample(n=100)['total_cup_points'].mean()
82.4897
coffee_ratings.sample(n=1000)['total_cup_points'].mean()
82.1186
Python में Sampling

सापेक्ष त्रुटियाँ

Population parameter:

population_mean = coffee_ratings['total_cup_points'].mean()

Point estimate:

sample_mean = coffee_ratings.sample(n=sample_size)['total_cup_points'].mean()

प्रतिशत में सापेक्ष त्रुटि:

rel_error_pct = 100 * abs(population_mean-sample_mean) / population_mean
Python में Sampling

सापेक्ष त्रुटि बनाम सैंपल साइज

import matplotlib.pyplot as plt
errors.plot(x="sample_size", 
            y="relative_error", 
            kind="line")
plt.show()

गुणधर्म:

  • काफी नॉइज़ी, खासकर छोटे सैंपल पर
  • शुरू में ढलान तेज, फिर सपाट
  • सैंपल साइज = population होने पर सापेक्ष त्रुटि शून्य की ओर जाती है

सैंपल साइज के मुकाबले सापेक्ष त्रुटि का लाइन प्लॉट.

Python में Sampling

अभ्यास करते हैं!

Python में Sampling

Preparing Video For Download...