Calcul 2020-2025 4408$ 159$ mise moyenne profit

This commit is contained in:
Jérôme Delacotte
2025-05-16 18:22:37 +02:00
parent b317e382f6
commit 74450db4ea
2 changed files with 16691 additions and 6795 deletions

View File

@@ -209,7 +209,23 @@ class Zeus_8_3_2_B_4_2(IStrategy):
protection_fibo = IntParameter(1, 10, default=2, space='protection')
sell_allow_decrease = DecimalParameter(0.005, 0.02, default=0.2, decimals=2, space='sell', optimize=True, load=True)
data = {
# Probabilité de hausse pour futur_percent_3h (en %):
# mid_smooth_deriv1_1h_bin B5 B4 B3 B2 B1 N0 H1 H2 H3 H4 H5
# sma24_diff_1h_bin
# B5 41.0 47.2 48.1 45.6 74.0 65.9 66.5 83.8 77.8 72.1 81.0
# B4 41.2 35.8 48.4 46.5 59.9 60.2 75.8 79.4 84.6 83.0 78.5
# B3 34.1 39.7 42.8 47.0 63.3 64.5 71.5 80.4 82.0 86.6 76.6
# B2 27.5 27.9 32.3 33.2 61.9 67.1 70.8 79.5 81.3 73.6 81.9
# B1 35.0 26.5 24.4 34.9 50.0 59.2 69.4 72.8 79.8 77.4 69.5
# N0 30.6 19.9 23.6 30.8 41.9 59.2 67.5 70.6 74.0 63.0 75.0
# H1 25.2 28.7 28.6 25.8 35.9 44.2 60.1 68.8 67.7 69.6 80.9
# H2 29.8 20.8 23.9 30.4 34.4 37.5 52.7 66.1 69.8 67.5 62.9
# H3 25.7 29.4 22.7 29.8 37.7 47.1 59.9 68.5 66.5 68.6 66.4
# H4 30.6 27.5 25.1 22.6 30.8 34.1 50.9 59.8 57.0 68.6 63.7
# H5 14.8 21.6 22.2 35.3 19.3 31.6 38.3 59.6 65.2 56.8 59.6
# Données sous forme de dictionnaire
smooth_smadiff_matrice = {
"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],
@@ -224,15 +240,60 @@ class Zeus_8_3_2_B_4_2(IStrategy):
}
index_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
matrix_df = pd.DataFrame(data, index=index_labels)
smooth_smadiff_matrice_df = pd.DataFrame(smooth_smadiff_matrice, index=index_labels)
# Récupération des labels ordonnés
ordered_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
label_to_index = {label: i for i, label in enumerate(ordered_labels)}
# Extraction de la matrice numérique
smooth_smadiff_numeric_matrice = smooth_smadiff_matrice_df.reindex(index=ordered_labels, columns=ordered_labels).values
smooth_pct_max_hour_matrice = {
'B5': [43.5, 52.7, 62.3, 65.5, 86.9, 63.1, 81.5, 86.7, 90.2, 90.1, 93.0],
'B4': [34.9, 46.3, 53.6, 60.4, 75.8, 83.3, 81.5, 83.0, 86.4, 86.9, 91.1],
'B3': [20.5, 35.4, 43.7, 54.5, 69.7, 71.6, 80.4, 84.7, 86.7, 84.9, 85.9],
'B2': [11.5, 25.4, 36.4, 47.9, 62.3, 65.7, 76.5, 82.0, 81.8, 82.8, 77.7],
'B1': [3.6, 14.9, 26.8, 41.1, 55.6, 71.4, 74.3, 79.8, 80.8, 82.3, 75.1],
'N0': [0.0, 6.9, 18.3, 32.0, 47.2, 62.1, 69.1, 74.8, 78.3, 76.6, 71.6],
'H1': [0.7, 3.8, 9.4, 24.2, 40.6, 59.7, 67.8, 70.9, 73.4, 72.1, 70.0],
'H2': [0.0, 0.6, 6.5, 13.6, 33.6, 51.7, 64.9, 70.2, 68.4, 67.8, 65.8],
'H3': [1.4, 0.6, 2.6, 6.6, 23.3, 50.2, 56.2, 63.6, 65.7, 64.5, 64.7],
'H4': [1.6, 0.3, 3.0, 3.2, 11.4, 32.7, 44.0, 54.9, 61.7, 60.6, 63.6],
'H5': [1.8, 2.6, 0.6, 1.1, 9.7, 12.9, 26.2, 44.5, 52.6, 54.5, 56.2],
}
smooth_pct_max_hour_matrice_df = pd.DataFrame(smooth_pct_max_hour_matrice, index=index_labels)
# Récupération des labels ordonnés
# ordered_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
# label_to_index = {label: i for i, label in enumerate(ordered_labels)}
# Extraction de la matrice numérique
smooth_pct_max_hour_numeric_matrice = smooth_pct_max_hour_matrice_df.reindex(index=ordered_labels, columns=ordered_labels).values
# Données sous forme de dictionnaire
smooth_sma_144_diff_matrice = {
"B5":[40.3, 52.1, 60.2, 68.6, 86.3, 76.5, 75.1, 83.5, 88.7, 96.3, 91.6],
"B4":[26.6, 39.4, 48.1, 57.0, 76.7, 82.4, 79.6, 82.4, 91.8, 86.6, 87.8],
"B3":[21.5, 27.7, 42.7, 53.2, 70.9, 76.6, 80.8, 79.4, 88.3, 88.0, 87.8],
"B2":[15.1, 20.8, 32.9, 46.9, 59.1, 79.6, 82.5, 79.6, 80.8, 87.0, 85.5],
"B1":[15.7, 15.4, 21.9, 29.4, 48.3, 66.6, 76.4, 77.8, 80.8, 83.5, 81.4],
"N0":[15.0, 10.5, 20.1, 24.5, 36.9, 59.9, 68.8, 74.1, 77.7, 83.0, 75.7],
"H1":[14.8, 10.7, 15.1, 21.0, 30.1, 47.3, 59.2, 70.4, 76.1, 82.7, 82.6],
"H2":[7.9, 8.6, 13.6, 20.6, 27.0, 39.5, 55.2, 68.9, 69.0, 78.4, 83.4],
"H3":[9.2, 6.2, 12.6, 21.7, 23.6, 33.1, 42.3, 57.8, 66.0, 71.9, 81.9],
"H4":[4.8, 13.1, 16.3, 14.5, 19.5, 26.4, 35.6, 49.2, 63.2, 68.2, 71.6],
"H5":[17.9, 25.7, 20.8, 17.8, 8.7, 18.5, 32.3, 37.7, 49.3, 59.8, 61.7]
}
smooth_sma_144_diff_matrice_df = pd.DataFrame(smooth_smadiff_matrice, index=index_labels)
# Extraction de la matrice numérique
smooth_sma_144_diff_numeric_matrice = smooth_sma_144_diff_matrice_df.reindex(index=ordered_labels, columns=ordered_labels).values
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str,
current_time: datetime, entry_tag: Optional[str], **kwargs) -> bool:
minutes = 0
if self.pairs[pair]['last_date'] != 0:
minutes = round((current_time - self.pairs[pair]['last_date']).total_seconds() / 60,0)
minutes = round(int((current_time - self.pairs[pair]['last_date']).total_seconds() / 60))
dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
last_candle = dataframe.iloc[-1].squeeze()
@@ -243,10 +304,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# print(f"restart {pair} last_sell={self.pairs[pair]['last_sell'] * 0.99} minutes={minutes}")
# self.pairs[pair]['stop'] = False
mid_smooth_label = self.get_mid_smooth_label(last_candle['mid_smooth_deriv1_1h']) # ex. 'B2'
sma24_diff_label = self.get_sma24_diff_label(last_candle['sma24_diff_1h'])
val = self.approx_val_from_bins(row_label=sma24_diff_label, col_label=mid_smooth_label)
val = self.getProbaHausse144(last_candle)
# allow_to_buy = True #(not self.stop_all) #& (not self.all_down)
allow_to_buy = not self.pairs[pair]['stop'] and val > 50 #not last_candle['tendency'] in ('B-', 'B--') # (rate <= float(limit)) | (entry_tag == 'force_entry')
@@ -354,6 +412,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
if (last_candle['tendency'] in ('H++', 'H+')) and (last_candle['rsi'] < 80):
return None
# val = self.getProbaHausse144(last_candle)
# if val > 50:
# return None
baisse = self.pairs[pair]['max_profit'] - current_profit
mx = self.pairs[pair]['max_profit'] / 5
if (baisse > mx) & (current_profit > expected_profit): #last_candle['min_max200'] / 3):
@@ -472,10 +534,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
else:
print(str)
def add_tendency_column(self, dataframe: pd.DataFrame) -> pd.DataFrame:
def add_tendency_column(self, dataframe: pd.DataFrame, suffixe='') -> pd.DataFrame:
def tag_by_derivatives(row):
d1 = row['mid_smooth_deriv1']
d2 = row['mid_smooth_deriv2']
d1 = row[f"mid_smooth_deriv1{suffixe}"]
d2 = row[f"mid_smooth_deriv2{suffixe}"]
d1_lim_inf = -0.01
d1_lim_sup = 0.01
if d1 >= d1_lim_inf and d1 <= d1_lim_sup: # and d2 >= d2_lim_inf and d2 <= d2_lim_sup:
@@ -488,7 +550,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return 'B--' if d2 < 0 else 'B-' # Accéleration Baisse / Ralentissement Baisse
return 'Mid'
dataframe['tendency'] = dataframe.apply(tag_by_derivatives, axis=1)
dataframe[f"tendency{suffixe}"] = dataframe.apply(tag_by_derivatives, axis=1)
return dataframe
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
@@ -500,9 +562,6 @@ class Zeus_8_3_2_B_4_2(IStrategy):
dataframe['haclose'] = heikinashi['close']
dataframe['hapercent'] = (dataframe['haclose'] - dataframe['haopen']) / dataframe['haclose']
dataframe['pct_change'] = dataframe['close'].pct_change(5)
dataframe = self.calculateTendency(dataframe)
dataframe['min'] = talib.MIN(dataframe['close'], timeperiod=200)
dataframe['min12'] = talib.MIN(dataframe['close'], timeperiod=12)
@@ -523,6 +582,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
dataframe['sma10_diff'] = 100 * dataframe['sma10'].diff() / dataframe['sma10']
dataframe['sma20'] = talib.SMA(dataframe, timeperiod=20)
dataframe['sma20_pct'] = 100 * dataframe['sma20'].diff() / dataframe['sma20']
dataframe['sma144'] = talib.SMA(dataframe, timeperiod=144)
dataframe['sma144_diff'] = 100 * dataframe['sma144'].diff() / dataframe['sma144']
dataframe["percent"] = (dataframe["close"] - dataframe["open"]) / dataframe["open"]
dataframe["percent3"] = (dataframe["close"] - dataframe["open"].shift(3)) / dataframe["open"].shift(3)
@@ -532,6 +593,9 @@ class Zeus_8_3_2_B_4_2(IStrategy):
dataframe["percent48"] = (dataframe["close"] - dataframe["open"].shift(48)) / dataframe["open"].shift(48)
dataframe["percent_max_144"] = (dataframe["close"] - dataframe["max144"]) / dataframe["close"]
dataframe = self.calculateTendency(dataframe, window=12)
dataframe = self.calculateTendency(dataframe, window=144, suffixe="_144", factor_1=1000, factor_2=10)
# print(metadata['pair'])
dataframe['rsi'] = talib.RSI(dataframe['close'], timeperiod=14)
dataframe['rsi_diff'] = dataframe['rsi'].diff()
@@ -561,7 +625,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# Compter les baisses consécutives
self.calculateDownAndUp(dataframe, limit=0.0001)
# dataframe = self.apply_regression_derivatives(dataframe, column='mid', window=24, degree=3)
dataframe = self.apply_regression_derivatives(dataframe, column='mid_smooth_144', window=144, degree=3, future_offset=12)
################### INFORMATIVE 1h
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe="1h")
@@ -652,6 +716,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# dataframe['amount'] = amount
print(f"amount= {amount}")
# dataframe['mid_smooth_tag'] = qtpylib.crossed_below(dataframe['mid_smooth_deriv1_144'], dataframe['mid_smooth_deriv2_144'])
dataframe['percent_with_previous_day'] = 100 * (dataframe['close'] - dataframe['close_1d']) / dataframe['close']
dataframe['percent_with_max_hour'] = 100 * (dataframe['close'] - dataframe['max12_1h']) / dataframe['close']
dataframe['futur_percent_1h'] = 100 * (dataframe['close'].shift(-12) - dataframe['close']) / dataframe['close']
dataframe['futur_percent_3h'] = 100 * (dataframe['close'].shift(-36) - dataframe['close']) / dataframe['close']
dataframe['futur_percent_5h'] = 100 * (dataframe['close'].shift(-60) - dataframe['close']) / dataframe['close']
@@ -670,16 +739,16 @@ class Zeus_8_3_2_B_4_2(IStrategy):
dataframe['down_pct'] = self.calculateUpDownPct(dataframe, 'down_count')
dataframe['up_pct'] = self.calculateUpDownPct(dataframe, 'up_count')
def calculateTendency(self, dataframe, window=12):
def calculateTendency(self, dataframe, window=12, suffixe='', factor_1=100, factor_2=10):
dataframe['mid'] = dataframe['open'] + (dataframe['close'] - dataframe['open']) / 2
# 2. Calcul du lissage par moyenne mobile médiane
dataframe['mid_smooth'] = dataframe['close'].rolling(window=window, center=True, min_periods=1).median().rolling(
3).mean()
dataframe[f"mid_smooth{suffixe}"] = dataframe['close'].rolling(window=window, center=True, min_periods=1).median().rolling(
int(window / 4)).mean()
# 2. Dérivée première = différence entre deux bougies successives
dataframe['mid_smooth_deriv1'] = round(100 * dataframe['mid_smooth'].diff() / dataframe['mid_smooth'], 4)
dataframe[f"mid_smooth_deriv1{suffixe}"] = round(factor_1 * dataframe[f"mid_smooth{suffixe}"].diff() / dataframe[f"mid_smooth{suffixe}"], 4)
# 3. Dérivée seconde = différence de la dérivée première
dataframe['mid_smooth_deriv2'] = round(10 * dataframe['mid_smooth_deriv1'].diff(), 4)
dataframe = self.add_tendency_column(dataframe)
dataframe[f"mid_smooth_deriv2{suffixe}"] = round(factor_2 * dataframe[f"mid_smooth_deriv1{suffixe}"].rolling(int(window / 4)).mean().diff(), 4)
dataframe = self.add_tendency_column(dataframe, suffixe)
return dataframe
def getOpenTrades(self):
@@ -707,10 +776,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
(
(dataframe['max200_diff'] >= 0.01)
& (dataframe['percent12'] < -0.002)
# & (dataframe['pct_change'] < 0)
& (dataframe['open'] < dataframe['average_line_288_099'])
& (dataframe['open'] < dataframe['average_line_50'])
# & (dataframe['percent'] >= -0.0005)
& (dataframe['min12'].shift(2) == dataframe['min12'])
& (dataframe['up_count'] > 0)
& (dataframe["bb_width"] > 0.01)
@@ -755,14 +822,18 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# pd.set_option('display.max_columns', None)
# Colonnes à traiter
futur_cols = ['futur_percent_1h', 'futur_percent_3h', 'futur_percent_5h', 'futur_percent_12h']
# futur_cols = ['futur_percent_1h', 'futur_percent_3h', 'futur_percent_5h', 'futur_percent_12h']
futur_cols = ['futur_percent_3h']
# Tranches équitables par quantiles
# Exemple pour 10 quantiles
labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
indic_1 = 'mid_smooth_deriv1_1h'
indic_2 = 'sma24_diff_1h'
#indic_1 = 'mid_smooth_deriv1_1h'
#indic_2 = 'sma24_diff_1h'
#indic_2 = 'percent_with_max_hour'
indic_1 = 'mid_smooth_deriv1_144'
indic_2 = 'mid_smooth_deriv2_144'
df[f"{indic_1}_bin"], bins_1h = pd.qcut(df[f"{indic_1}"], q=11, labels=labels, retbins=True, duplicates='drop')
df[f"{indic_2}_bin"], bins_1d = pd.qcut(df[f"{indic_2}"], q=11, labels=labels, retbins=True, duplicates='drop')
@@ -770,9 +841,9 @@ class Zeus_8_3_2_B_4_2(IStrategy):
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 300) # largeur max affichage
# Afficher les bornes
print(f"Bornes des quantiles pour {indic_1} :", bins_1h)
print(f"Bornes des quantiles pour {indic_2} :", bins_1d)
# Affichage formaté pour code Python
print(f"Bornes des quantiles pour {indic_1} : [{', '.join([f'{b:.4f}' for b in bins_1h])}]")
print(f"Bornes des quantiles pour {indic_2} : [{', '.join([f'{b:.4f}' for b in bins_1d])}]")
# Agrégation
grouped = df.groupby([f"{indic_2}_bin", f"{indic_1}_bin"], observed=True)[futur_cols].agg(['mean', 'count'])
@@ -793,6 +864,16 @@ class Zeus_8_3_2_B_4_2(IStrategy):
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
print((proba_up * 100).round(1))
# Affichage formaté des valeurs comme tableau Python
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
df_formatted = (proba_up * 100).round(1)
print("data = {")
for index, row in df_formatted.iterrows():
row_values = ", ".join([f"{val:.1f}" for val in row])
print(f"'{index}': [{row_values}], ")
print("}")
return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
@@ -840,17 +921,6 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return None
count_of_buys = trade.nr_of_successful_entries
# if (days_since_first_buy >= 5 and count_of_buys >= 4 and last_candle['sma5_pct_1d'] < 0):
# # print(f"waiting day increase pair {pair}")
# return None
# if 'buy' in last_candle:
# condition = (last_candle['buy'] == 1)
# else:
# condition = False
# self.protection_nb_buy_lost.value
current_time_utc = current_time.astimezone(timezone.utc)
open_date = trade.open_date.astimezone(timezone.utc)
days_since_open = (current_time_utc - open_date).days
@@ -870,10 +940,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
lim = - pct - (count_of_buys * 0.001)
# print(f"{trade.pair} current_profit={current_profit} count_of_buys={count_of_buys} pct_max={pct_max:.3f} lim={lim:.3f} rsi_diff_1f={last_candle['rsi_diff_1h']}")
mid_smooth_label = self.get_mid_smooth_label(last_candle['mid_smooth_deriv1_1h']) # ex. 'B2'
sma24_diff_label = self.get_sma24_diff_label(last_candle['sma24_diff_1h'])
val = self.approx_val_from_bins(row_label=sma24_diff_label, col_label=mid_smooth_label)
val = self.getProbaHausse144(last_candle)
# print(f"Valeur approximée pour B3 / H2 : {val:.2f}")
# if (days_since_open > count_of_buys) & (0 < count_of_buys <= max_buys) & (current_rate <= limit) & (last_candle['enter_long'] == 1):
@@ -936,10 +1003,34 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return None
def getProbaHausse144(self, last_candle, indic_1='mid_smooth_deriv1_144', indic_2='sma144_diff'):
value_1 = self.get_mid_smooth_label(last_candle[indic_1]) # ex. 'B2'
value_2 = self.get_sma24_diff_label(last_candle[indic_2])
val = self.approx_val_from_bins(matrice=self.smooth_sma_144_diff_matrice_df, numeric_matrice=self.smooth_sma_144_diff_numeric_matrice, row_label=value_2,
col_label=value_1)
return val
def getProbaHausse(self, last_candle, indic_1='mid_smooth_deriv1_1h', indic_2='sma24_diff_1h'):
value_1 = self.get_mid_smooth_label(last_candle[indic_1]) # ex. 'B2'
value_2 = self.get_sma24_diff_label(last_candle[indic_2])
val = self.approx_val_from_bins(matrice=self.smooth_smadiff_matrice_df, numeric_matrice=self.smooth_smadiff_numeric_matrice, row_label=value_2,
col_label=value_1)
return val
def adjust_stake_amount(self, pair: str, last_candle: DataFrame):
# Calculer le minimum des 14 derniers jours
base_stake_amount = self.config.get('stake_amount', 100) # Montant de base configuré
# if (self.pairs[pair]['count_of_buys'] == 0):
# mid_smooth_label = self.get_mid_smooth_label(last_candle['mid_smooth_deriv1_1h']) # ex. 'B2'
# percent_with_max_hour = self.get_sma24_diff_label(last_candle['percent_with_max_hour'])
#
# val = self.approx_val_from_bins(matrice=self.smooth_pct_max_hour_matrice_df, row_label=percent_with_max_hour, col_label=mid_smooth_label)
#
# base_stake_amount = base_stake_amount * (1 + val / 500)
first_price = self.pairs[pair]['first_buy']
if (first_price == 0):
first_price = last_candle['close']
@@ -1067,9 +1158,6 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return labels[i]
return labels[-1]
import numpy as np
import pandas as pd
def interpolated_val_from_bins(self, row_pos, col_pos):
"""
Renvoie une approximation interpolée (bilinéaire) d'une valeur dans la matrice
@@ -1093,7 +1181,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return np.nan
# Conversion des labels -> matrice
matrix = self.matrix_df.reindex(index=labels, columns=labels).values
matrix = self.smooth_smadiff_matrice_df.reindex(index=labels, columns=labels).values
# Coordonnées entières (inférieures)
i = int(np.floor(row_pos))
@@ -1122,7 +1210,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
)
return interpolated
def approx_val_from_bins(self, row_label, col_label):
def approx_val_from_bins(self, matrice, numeric_matrice, row_label, col_label):
"""
Renvoie une approximation de la valeur à partir des labels binaires (e.g. B5, H1)
en utilisant une interpolation simple basée sur les indices.
@@ -1137,22 +1225,15 @@ class Zeus_8_3_2_B_4_2(IStrategy):
"""
# Vérification des labels
if row_label not in self.matrix_df.index or col_label not in self.matrix_df.columns:
if row_label not in matrice.index or col_label not in matrice.columns:
return np.nan
# Récupération des labels ordonnés
ordered_labels = ['B5', 'B4', 'B3', 'B2', 'B1', 'N0', 'H1', 'H2', 'H3', 'H4', 'H5']
label_to_index = {label: i for i, label in enumerate(ordered_labels)}
# Index correspondant
row_idx = label_to_index.get(row_label)
col_idx = label_to_index.get(col_label)
# Extraction de la matrice numérique
numeric_matrix = self.matrix_df.reindex(index=ordered_labels, columns=ordered_labels).values
row_idx = self.label_to_index.get(row_label)
col_idx = self.label_to_index.get(col_label)
# Approximation directe (aucune interpolation complexe ici, juste une lecture)
return numeric_matrix[row_idx, col_idx]
return numeric_matrice[row_idx, col_idx]
# @property

File diff suppressed because it is too large Load Diff