Display correlation values in AutoCorrelationsResult
This commit is contained in:
parent
90cc780086
commit
7d080f7d20
@ -314,4 +314,19 @@ class AutoCorrelationsResult:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
sns.heatmap(self.correlations, vmin=-1, vmax=1, cmap='RdBu')
|
|
||||||
|
# Format values without leading 0
|
||||||
|
def fmt_value(v):
|
||||||
|
if v >= 0.995:
|
||||||
|
return '1.0'
|
||||||
|
if v <= -0.995:
|
||||||
|
return '-1.0'
|
||||||
|
if v < 0:
|
||||||
|
if v >= -0.005:
|
||||||
|
return '.00'
|
||||||
|
return '-' + format(-v, '.2f').lstrip('0')
|
||||||
|
return format(v, '.2f').lstrip('0')
|
||||||
|
|
||||||
|
correlation_values = self.correlations.applymap(fmt_value)
|
||||||
|
|
||||||
|
sns.heatmap(self.correlations, vmin=-1, vmax=1, cmap='RdBu', annot=correlation_values, fmt='', annot_kws={'fontsize': 'small'})
|
||||||
|
Loading…
Reference in New Issue
Block a user