Skip to Content
Java数据科学实战
book

Java数据科学实战

by Michael R. Brzustowicz, PhD
January 2020
Intermediate to advanced
202 pages
5h 41m
Chinese
Posts & Telecom Press
Content preview from Java数据科学实战
68
|
第
3
章
直方图的代码采用了第
1
章的
BarChar
图,只是直接从
EmpiricalDistribution
实例中添加
数据,该实例包含了每个桶中所有
SummaryStatistics
的
List
。
/* 已经装载数据的现有EmpiricalDistribution对象 */
List<SummaryStatistics> ss = dist.getBinStats();
int
binNum = 0;
for
(SummaryStatistics s : ss) {
/* 把桶的个数添加到XYChart.Series实例 */
series.getData().add(
new
Data(Integer.toString(binNum++), s.getN()));
}
// 采用JavaFX BarChart绘制直方图
3.1.6
 离散分布
有几种离散随机数的分布,它们只支持整型值(记作
k
)。
1.
伯努利分布
伯努利分布
(
Bernoulli distribution
)是最基本的分布,或许也是最为人所熟知的分布,因
为它本质上是抛硬币。在“正面赢,反面输”的情形中,硬币有两种可能的状态:正面
(
k
=
1
)以及反面(
k
=
0
),其中
k
=
1
记作成功,其概率等于
p
。若硬币是均匀的,则
p
=
1/2
,即得到正面的概率和得到反面的概率相等。但是,若硬币是非均匀的,即
p
≠
1/2
,
会如何呢?此时就要用到概率质量函数(
PMF
),如下式所示:
1, 0
()
, 1
pk
fk
pk
−=
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

云安全实用指南

云安全实用指南

Chris Dotson
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino

Publisher Resources

ISBN: 9787115533302