male/female voices in separate plots for correlations
This commit is contained in:
@@ -560,6 +560,56 @@ S.plot_speaking_style_color_correlation(
|
|||||||
title="Correlation: Speaking Style Colors and Voice Ranking Points"
|
title="Correlation: Speaking Style Colors and Voice Ranking Points"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Gender-filtered correlation plots (Male vs Female voices)
|
||||||
|
from reference import VOICE_GENDER_MAPPING
|
||||||
|
|
||||||
|
MALE_VOICES = [v for v, g in VOICE_GENDER_MAPPING.items() if g == "Male"]
|
||||||
|
FEMALE_VOICES = [v for v, g in VOICE_GENDER_MAPPING.items() if g == "Female"]
|
||||||
|
|
||||||
|
# Filter joined data by voice gender
|
||||||
|
joined_scale_male = joined_scale.filter(pl.col("Voice").is_in(MALE_VOICES))
|
||||||
|
joined_scale_female = joined_scale.filter(pl.col("Voice").is_in(FEMALE_VOICES))
|
||||||
|
joined_ranking_male = joined_ranking.filter(pl.col("Voice").is_in(MALE_VOICES))
|
||||||
|
joined_ranking_female = joined_ranking.filter(pl.col("Voice").is_in(FEMALE_VOICES))
|
||||||
|
|
||||||
|
# Colors vs Scale 1-10 (Male voices only)
|
||||||
|
color_corr_scale_male, _ = utils.transform_speaking_style_color_correlation(joined_scale_male, SPEAKING_STYLES)
|
||||||
|
S.plot_speaking_style_color_correlation(
|
||||||
|
data=color_corr_scale_male,
|
||||||
|
title="Correlation: Speaking Style Colors and Voice Scale 1-10 (Male Voices Only)"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Colors vs Scale 1-10 (Female voices only)
|
||||||
|
color_corr_scale_female, _ = utils.transform_speaking_style_color_correlation(joined_scale_female, SPEAKING_STYLES)
|
||||||
|
S.plot_speaking_style_color_correlation(
|
||||||
|
data=color_corr_scale_female,
|
||||||
|
title="Correlation: Speaking Style Colors and Voice Scale 1-10 (Female Voices Only)"
|
||||||
|
)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Colors vs Ranking Points (Male voices only)
|
||||||
|
color_corr_ranking_male, _ = utils.transform_speaking_style_color_correlation(
|
||||||
|
joined_ranking_male,
|
||||||
|
SPEAKING_STYLES,
|
||||||
|
target_column="Ranking_Points"
|
||||||
|
)
|
||||||
|
S.plot_speaking_style_color_correlation(
|
||||||
|
data=color_corr_ranking_male,
|
||||||
|
title="Correlation: Speaking Style Colors and Voice Ranking Points (Male Voices Only)"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Colors vs Ranking Points (Female voices only)
|
||||||
|
color_corr_ranking_female, _ = utils.transform_speaking_style_color_correlation(
|
||||||
|
joined_ranking_female,
|
||||||
|
SPEAKING_STYLES,
|
||||||
|
target_column="Ranking_Points"
|
||||||
|
)
|
||||||
|
S.plot_speaking_style_color_correlation(
|
||||||
|
data=color_corr_ranking_female,
|
||||||
|
title="Correlation: Speaking Style Colors and Voice Ranking Points (Female Voices Only)"
|
||||||
|
)
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
mo.md(r"""
|
mo.md(r"""
|
||||||
### Individual Traits vs Scale 1-10
|
### Individual Traits vs Scale 1-10
|
||||||
@@ -608,6 +658,82 @@ for _style, _traits in SPEAKING_STYLES.items():
|
|||||||
"""
|
"""
|
||||||
mo.md(_content)
|
mo.md(_content)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Individual Traits vs Scale 1-10 (Male voices only)
|
||||||
|
_content = """### Individual Traits vs Scale 1-10 (Male Voices Only)\n\n"""
|
||||||
|
|
||||||
|
for _style, _traits in SPEAKING_STYLES.items():
|
||||||
|
_fig = S.plot_speaking_style_scale_correlation(
|
||||||
|
data=joined_scale_male,
|
||||||
|
style_color=_style,
|
||||||
|
style_traits=_traits,
|
||||||
|
title=f"Correlation: Speaking Style {_style} and Voice Scale 1-10 (Male Voices Only)",
|
||||||
|
)
|
||||||
|
_content += f"""
|
||||||
|
#### Speaking Style **{_style}**:
|
||||||
|
|
||||||
|
{mo.ui.altair_chart(_fig)}
|
||||||
|
|
||||||
|
"""
|
||||||
|
mo.md(_content)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Individual Traits vs Scale 1-10 (Female voices only)
|
||||||
|
_content = """### Individual Traits vs Scale 1-10 (Female Voices Only)\n\n"""
|
||||||
|
|
||||||
|
for _style, _traits in SPEAKING_STYLES.items():
|
||||||
|
_fig = S.plot_speaking_style_scale_correlation(
|
||||||
|
data=joined_scale_female,
|
||||||
|
style_color=_style,
|
||||||
|
style_traits=_traits,
|
||||||
|
title=f"Correlation: Speaking Style {_style} and Voice Scale 1-10 (Female Voices Only)",
|
||||||
|
)
|
||||||
|
_content += f"""
|
||||||
|
#### Speaking Style **{_style}**:
|
||||||
|
|
||||||
|
{mo.ui.altair_chart(_fig)}
|
||||||
|
|
||||||
|
"""
|
||||||
|
mo.md(_content)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Individual Traits vs Ranking Points (Male voices only)
|
||||||
|
_content = """### Individual Traits vs Ranking Points (Male Voices Only)\n\n"""
|
||||||
|
|
||||||
|
for _style, _traits in SPEAKING_STYLES.items():
|
||||||
|
_fig = S.plot_speaking_style_ranking_correlation(
|
||||||
|
data=joined_ranking_male,
|
||||||
|
style_color=_style,
|
||||||
|
style_traits=_traits,
|
||||||
|
title=f"Correlation: Speaking Style {_style} and Voice Ranking Points (Male Voices Only)",
|
||||||
|
)
|
||||||
|
_content += f"""
|
||||||
|
#### Speaking Style **{_style}**:
|
||||||
|
|
||||||
|
{mo.ui.altair_chart(_fig)}
|
||||||
|
|
||||||
|
"""
|
||||||
|
mo.md(_content)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
# Individual Traits vs Ranking Points (Female voices only)
|
||||||
|
_content = """### Individual Traits vs Ranking Points (Female Voices Only)\n\n"""
|
||||||
|
|
||||||
|
for _style, _traits in SPEAKING_STYLES.items():
|
||||||
|
_fig = S.plot_speaking_style_ranking_correlation(
|
||||||
|
data=joined_ranking_female,
|
||||||
|
style_color=_style,
|
||||||
|
style_traits=_traits,
|
||||||
|
title=f"Correlation: Speaking Style {_style} and Voice Ranking Points (Female Voices Only)",
|
||||||
|
)
|
||||||
|
_content += f"""
|
||||||
|
#### Speaking Style **{_style}**:
|
||||||
|
|
||||||
|
{mo.ui.altair_chart(_fig)}
|
||||||
|
|
||||||
|
"""
|
||||||
|
mo.md(_content)
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
# ## Correlations when "Best Brand Character" is chosen
|
# ## Correlations when "Best Brand Character" is chosen
|
||||||
# For each of the 4 brand characters, filter the dataset to only those respondents
|
# For each of the 4 brand characters, filter the dataset to only those respondents
|
||||||
|
|||||||
Reference in New Issue
Block a user