Ajout calcul de probabilité fonction de 2 indicateurs
This commit is contained in:
30
tools/statistique/carte_thermique.py
Normal file
30
tools/statistique/carte_thermique.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
import pandas as pd
|
||||
|
||||
# Données : probabilité de hausse (%) selon sma24_diff_1h_bin vs mid_smooth_deriv1_1h_bin
|
||||
data = {
|
||||
"B5": [41.0, 41.2, 34.1, 27.5, 35.0, 30.6, 25.2, 29.8, 25.7, 30.6, 14.8],
|
||||
"B4": [47.2, 35.8, 39.7, 27.9, 26.5, 19.9, 28.7, 20.8, 29.4, 27.5, 21.6],
|
||||
"B3": [48.1, 48.4, 42.8, 32.3, 24.4, 23.6, 28.6, 23.9, 22.7, 25.1, 22.2],
|
||||
"B2": [45.6, 46.5, 47.0, 33.2, 34.9, 30.8, 25.8, 30.4, 29.8, 22.6, 35.3],
|
||||
"B1": [74.0, 59.9, 63.3, 61.9, 50.0, 41.9, 35.9, 34.4, 37.7, 30.8, 19.3],
|
||||
"N0": [65.9, 60.2, 64.5, 67.1, 59.2, 59.2, 44.2, 37.5, 47.1, 34.1, 31.6],
|
||||
"H1": [66.5, 75.8, 71.5, 70.8, 69.4, 67.5, 60.1, 52.7, 59.9, 50.9, 38.3],
|
||||
"H2": [83.8, 79.4, 80.4, 79.5, 72.8, 70.6, 68.8, 66.1, 68.5, 59.8, 59.6],
|
||||
"H3": [77.8, 84.6, 82.0, 81.3, 79.8, 74.0, 67.7, 69.8, 66.5, 57.0, 65.2],
|
||||
"H4": [72.1, 83.0, 86.6, 73.6, 77.4, 63.0, 69.6, 67.5, 68.6, 68.6, 56.8],
|
||||
"H5": [81.0, 78.5, 76.6, 81.9, 69.5, 75.0, 80.9, 62.9, 66.4, 63.7, 59.6]
|
||||
}
|
||||
|
||||
index_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
|
||||
df = pd.DataFrame(data, index=index_labels)
|
||||
|
||||
# Affichage en carte thermique
|
||||
plt.figure(figsize=(12, 8))
|
||||
sns.heatmap(df, annot=True, fmt=".1f", cmap="RdYlGn", cbar_kws={'label': 'Probabilité de hausse (%)'})
|
||||
plt.title("Carte thermique : Probabilité de hausse selon sma24_diff_1h_bin et mid_smooth_deriv1_1h_bin")
|
||||
plt.xlabel("mid_smooth_deriv1_1h_bin")
|
||||
plt.ylabel("sma24_diff_1h_bin")
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user