Skip to Main Content
弱监督学习实用指南
book

弱监督学习实用指南

by Wee Hyong Tok, Amit Bahree, Senja Filipi
January 2023
Beginner to intermediate content levelBeginner to intermediate
209 pages
3h 55m
Chinese
Southeast University Press
Content preview from 弱监督学习实用指南
38
2
PandasParallelLFApplier
这个
applier
通过将
Pandas
数据帧并行化为
Dask DataFrame
来操作,并使
DaskLFApplier
来并行处理分区,因此比
PandasLFApplier
更快。
SparkLFApplier
Spark
弹性分布式数据集(
RDD
)上应用标签功能。
在我们的例子中,由于数据量很小,而且这个过程可以很容易地在台式机或
笔记本电脑上运行,所以我们将使用
PandasLFApplier
让我们导入
Snorkel PandasLFApplier
from snorkel.labeling import PandasLFApplier
接下来,让我们定义一个数组,
lfs
,在这里我们将声明所有的标签函数,然
后使用
lfs
初始化
applier PandasLFApplier
。最后使用
applier.apply
将标签
函数应用到数据帧
df
中:
lfs = [
is_odd,
is_even,
is_two,
is_known_prime
]
applier = PandasLFApplier(lfs=lfs)
L_train = applier.apply(df=df)
标签的性能分析
应用标签函数后,我们可以对它们的表现进行分析。
Snorkel
配备了
LFAnalysis
,它通过描述极性、覆盖率、重叠率和冲突率来总结标签函
数的性能。为了使用
LFAnalysis
,让我们从导入软件包开始,然后输出
LFAnalysis ...
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.
Start your free trial

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787576602630