python度量學習
Hi folks, welcome back to my new edition of the blog, thank you so much for your love and support, I hope you all are doing well. In today’s learning, we will try to understand about variance and the measures involved in it. Although the blog is very small based on content, I’m sure this will help you all understand things in a better aspect. So let’s start understanding it.
大家好,歡迎回到我的新版博客,非常感謝您的愛戴與支持,希望大家一切都好。 在今天的學習中,我們將嘗試了解方差及其涉及的度量。 盡管基于內容的博客很小,但我相信這將幫助大家更好地理解事物。 因此,讓我們開始了解它。
In statistics, variance is a measure of how far a value in a data set lies from the mean value. In other words, it indicates how dispersed the values are. It is measured by using standard deviation. The other method commonly used is skewness. Both of these are calculated by using functions available in pandas library.
在統計數據中,方差是數據集中某個值與平均值之間的距離的量度。 換句話說,它指示值的分散程度。 通過使用標準偏差進行測量。 常用的另一種方法是偏度。 這兩個都是通過使用pandas庫中可用的函數來計算的。
測量標準偏差 (Measuring Standard Deviation)
Standard deviation is square root of variance. variance is the average of squared difference of values in a data set from the mean value. In python we calculate this value by using the function std() from pandas library.
標準偏差是方差的平方根。 方差是數據集中值與平均值的平方差的平均值。 在python中,我們通過使用pandas庫中的函數std()計算此值。
# Measuring The Standard Deviation Exampleimport pandas as pd#Create a Dictionary of seriesa = {'Name': pd.Series(['Madhav','Ramesh','Divya','Ankita','Santosh','Ketan', 'Niloy','Preethi','Bhaskar','Deeksha']),'Age': pd.Series([25,26,25,23,30,25,23,34,40,30]),'Rating':pd.Series([4.23,3.24,3.98,2.56,3.20,4.6,3.8,3.78,2.98,4.80[)# Create a Dataframedf = pd.DataFrame(a)# Calculate the Standard Deviationprint(repr(df.std()))
Its output is as follows ?
其輸出如下-
Age 5.466057
Rating 0.720525
dtype: float64
測量偏度 (Measuring Skewness)
It used to determine whether the data is symmetric or skewed. If the index is between -1 and 1, then the distribution is symmetric. If the index is no more than -1 then it is skewed to the left and if it is at least 1, then it is skewed to the right
它用于確定數據是對稱的還是偏斜的。 如果索引在-1和1之間,則分布是對稱的。 如果索引不大于-1,則向左傾斜,如果索引至少為1,則向右傾斜
# Measuring The Skewness Exampleimport pandas as pd#Create a Dictionary of seriesa = {'Name': pd.Series(['Madhav','Ramesh','Divya','Ankita','Santosh','Ketan',
'Niloy','Preethi','Bhaskar','Deeksha']),'Age': pd.Series([25,26,25,23,30,25,23,34,40,30]),'Rating':pd.Series([4.23,3.24,3.98,2.56,3.20,4.6,3.8,3.78,2.98,4.80])}# Create a Dataframedf = pd.DataFrame(a)# Calculate the Standard Deviationprint(repr(df.skew()))
Its output is as follows ?
其輸出如下-
Age 1.309954
Rating -0.030865
dtype: float64
So the distribution of age rating is symmetric while the distribution of age is skewed to the right.
因此,年齡等級的分布是對稱的,而年齡分布則偏向右側。
Also Attacking the ipynb file for reference
同時攻擊ipynb文件以供參考
I hope the above collection of stuff is knowledgeable and would have given you a glance about the topic and on this note, I would like to sign off for today. I would love to know if you wish me to cover any topic related to data science , Machine learning etc, then please do leave your comments in the comment section on my blogs so that i can make note of those blogs and write is for everyone’s learning.
我希望以上收集的知識豐富,并能使您對該主題有所了解,在此注意,我今天要簽字。 我很想知道您是否希望涵蓋與數據科學,機器學習等相關的任何主題,然后請務必在博客的評論部分中留下您的評論 ,以便我可以記下那些博客并寫給大家學習。
Do follow me to get updates regarding all my blogs on Medium & LinkedIn. If you really like the above stuffs then do comment below because learning has no limits .
請關注我,以獲取有關我在Medium和LinkedIn上所有博客的更新。 如果您真的喜歡上述內容,請在下面做評論,因為學習沒有限制。
Stay Happy, Stay Fit, Stay Humble…!
保持快樂,保持健康,保持謙虛……!
Thank you for reading …!
謝謝您的閱讀……!
翻譯自: https://medium.com/swlh/measures-of-variance-with-python-723386c80bdc
python度量學習
本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。 如若轉載,請注明出處:http://www.pswp.cn/news/388238.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/388238.shtml 英文地址,請注明出處:http://en.pswp.cn/news/388238.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!