pythonbook/实例学习spotlight/1.py

11 lines
590 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import datasets
from renumics import spotlight
# 加载名为'renumics/emodb-enriched'的数据集,如同武林高手寻找传说中的秘籍
ds = datasets.load_dataset('renumics/emodb-enriched', split='all')
# 定义一个布局,专门用于调试性别分类问题,如同制定一套针对对手的战斗策略
layout = spotlight.layouts.debug_classification(label='gender', prediction='m1_gender_prediction', embedding='m1_embedding', features=['age', 'emotion'])
# 使用spotlight展示数据和布局如同武林高手展示其绝世武功
spotlight.show(ds, layout=layout)