python度量学习_Python的差异度量

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 .

请关注我,以获取有关我在MediumLinkedIn上所有博客的更新。 如果您真的喜欢上述内容,请在下面做评论,因为学习没有限制。

Stay Happy, Stay Fit, Stay Humble…!

保持快乐,保持健康,保持谦虚……!

Thank you for reading …!

谢谢您的阅读……!

翻译自: https://medium.com/swlh/measures-of-variance-with-python-723386c80bdc

python度量学习

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值