Team Ai
Apppublic

Deepvest/ProfilingAI

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
ml_analyzer.cpython-310.pyc216 linesDownload Raw Back to __pycache__
1o

2J��g��@s�ddlZddlZddlmZmZmZmZddl	m	Z	ddl3mZmZddl
mZddlZddlmZddlZddlmZmZddlmZGd	d4�d5�ZGdd�d�ZGd
d�d�ZGdd�d�ZGdd�d�ZGdd�de�ZdS)�N)�Dict�List�Optional�Any)�datetime)�RandomForestClassifier�GradientBoostingRegressor)�StandardScaler)�
AutoTokenizer�"AutoModelForSequenceClassification�)�MLAnalyzerProtocolc@sJeZdZdZdd�Zdeedefdd�Zde	j6deeeffd	d7�ZdS)�AlternativeDataAnalyzerz4Analyze alternative data sources for market insightscCstdd�|_tdd�|_dS)N�d)�n_estimators�2)r�social_sentiment_model�web_traffic_model��self�r�;/Users/sandrine/Deepvest_system/src/analysis/ml_analyzer.py�__init__sz AlternativeDataAnalyzer.__init__�social_data�returncCs|�|�}t|j�|�d�S)zAnalyze social media sentimentr)Z_extract_social_features�floatr�predict)rr�featuresrrr�analyze_social_sentiments8z0AlternativeDataAnalyzer.analyze_social_sentiment�traffic_datacCs4|�|�}|j�|�}tt�|��tt�|��d�S)zAnalyze web traffic patterns)�growth_score�trend_strength)Z_prepare_traffic_featuresrrr�np�mean�std)rrr�predictionsrrr�analyze_web_traffics910�z+AlternativeDataAnalyzer.analyze_web_trafficN)
�__name__�11__module__�__qualname__�__doc__rrrrr�pd�	DataFrame�strr&rrrrrs12 rc@s�eZdZdZdd�Z	d'dedejdee	de	e13effd	d14�Zdedejdee	dej
fdd�Zd
edee	defdd�Zdej
defdd�Zdedejde	e15effdd�Zdedejdefdd�Zdededejde	e16effdd�Zedejdefdd��Zedejdefdd��Zedee	defdd ��Zedejdefd!d"��Zedee	defd#d$��Zedejdefd%d&��ZdS)(�MarketImpactPredictorz7Predicts market impact of trades using machine learningcCs(tddddd�|_t�|_gd�|_dS)Nr皙�����?��*)r�
learning_rate�	max_depth�random_state)�trade_size_norm�volume_profile�17volatility�bid_ask_spreadZ
market_regime�time_of_day)r�impact_modelr	�scaler�feature_columnsrrrrr)s�zMarketImpactPredictor.__init__N�18trade_size�market_data�market_conditionsrc19Cs�z6|�|||�}|j�|�}t|j�|�d�}|�||�}|�|�}|�||�}	||||	|�	|||�d�WSt20yY}21ztd|22���|�||�did�WYd}23~24Sd}25~26ww)aO27        Predict market impact of a trade28        29        Args:30            trade_size: Size of the trade31            market_data: Market data (prices, volumes, etc.)32            market_conditions: Additional market condition indicators33            34        Returns:35            Dictionary with impact predictions and metrics36        r)�predicted_impact�base_impact�37confidence�risk_metricsZrecommended_sizingz Error predicting market impact: �)r@rBrCN)
�_extract_impact_featuresr;�	transformrr:r�_adjust_for_market_conditions� _calculate_prediction_confidence�_calculate_impact_risk_metrics�_calculate_recommended_sizing�	Exception�print�_calculate_simple_impact)rr=r>r?r�scaled_featuresrAZadjusted_impactrBrC�errr�predict_trade_impact:sL��38�������z*MarketImpactPredictor.predict_trade_impactc
39Cs�zVg}|d��}|dkr||nd}|�|�|�|�}|�|�|d����}|�|�|�|�}	|�|	�|�|�}40|�|41�|�|�}|�|�t�	|��42dd�WStyy}ztd|���t�
dt|j�f�WYd}~Sd}~ww)z&Extract features for impact prediction�volumer�close������z"Error extracting impact features: N)r#�append�_calculate_volume_profile�43pct_changer$�_calculate_bid_ask_spread�_get_regime_indicator�_calculate_time_featurer"�array�reshaperKrL�zeros�lenr<)
rr=r>r?r�44avg_volumer5r6r7�spreadZregime_indicatorZtime_featurerOrrrrE{s*45464748495051525354 ��z.MarketImpactPredictor._extract_impact_featuresrAc55Cs~z#|s|WS|�dd�}d|�dd�}|�|�}|||}||WSty>}ztd|���|WYd}~Sd}~ww)z3Adjust impact prediction based on market conditionsr7��?rS�	liquidityz'Error adjusting for market conditions: N)�get�_get_regime_factorrKrL)rrAr?Zvolatility_factorZliquidity_factorZ
regime_factor�56adjustmentrOrrrrG�s5758��z3MarketImpactPredictor._adjust_for_market_conditionsrc59Cs�z.d}t|d�D]\}}t�|�st�|�r|d9}q	|dd}|dkr*|d9}t|�WStyH}ztd|���WYd}~dSd}~ww)z0Calculate confidence score for impact prediction皙�����?rr/g�������?z)Error calculating prediction confidence: N��?)�	enumerater"�isnan�isinfrrKrL)rrrB�i�featurer5rOrrrrH�s�60��z6MarketImpactPredictor._calculate_prediction_confidence�impactc61Cshzi}|d|d<|d|d<|�|�|d<|WSty3}ztd|���iWYd}~Sd}~ww)z,Calculate risk metrics for impact predictiongR���Q�?Z
impact_var_95rZmax_slippageZtiming_riskz'Error calculating impact risk metrics: N)�_calculate_timing_riskrKrL)rrmr>�metricsrOrrrrI�s��z4MarketImpactPredictor._calculate_impact_risk_metricsc62Csfz|d��}|dkr||nd}dt�|�WSty2}ztd|���WYd}~dSd}~ww)z'Calculate simple market impact estimaterQrr/z!Error calculating simple impact: Ng{�G�z�?)r#r"�sqrtrKrL)rr=r>r_�participation_raterOrrrrM�s��z.MarketImpactPredictor._calculate_simple_impactr@c	63Cs�z+|d��}t||d�}t||d�}t||d�}t|�t|�t|�t|�d�WStyJ}ztd|���d|diWYd}~Sd}~ww)	z"Calculate recommended trade sizingrQr/皙�����?�{�G�z�?)Zaggressive_sizeZnormal_sizeZpassive_size�optimal_sizez&Error calculating recommended sizing: rtN)r#�minrrKrL)	rr=r@r>r_Z64aggressive�normalZpassiverOrrrrJ�s���z3MarketImpactPredictor._calculate_recommended_sizingcCsDz|d�d���}|d��}|dkr||WSdWSYdS)zCalculate volume profile metricrQ�rra)�tailr#)r>Z
recent_volumeZhist_volumerrrrVsz/MarketImpactPredictor._calculate_volume_profilecCsJzd|vrd|vr|d|d|d}t|���WSWdSYdS)z Calculate average bid-ask spread�bid�askg����MbP?)rr#)r>r`rrrrXsz/MarketImpactPredictor._calculate_bid_ask_spreadcC�Bz|sWdS|�dd�}dddddd�}|�|d�WSYdS)	z)Get numerical indicator for market regimerD�regimervg�g�rgra��crisis�stressrvZcalmZ
highly_liquid�rc)r?r|�65regime_maprrrrY$��z+MarketImpactPredictor._get_regime_indicatorcCsDzt|jtj�r|jdj}t�tj|d�WSWdSYdS)zCalculate time of day featurerT�rD)�66isinstance�indexr+�
DatetimeIndex�hourr"�sin�pi)r>r�rrrrZ6sz-MarketImpactPredictor._calculate_time_featurecCr{)	z'Get adjustment factor for market regimerar|rvg@g�?rfrgr}r�)r?r|Zregime_factorsrrrrdBr�z(MarketImpactPredictor._get_regime_factorcCs6z|d��}|��}t|t�d��WSYdS)zCalculate timing risk metricrR��皙�����?)rWr$rr"rp)r>�returnsr7rrrrnTsz,MarketImpactPredictor._calculate_timing_risk�N)r'r(r)r*rrr+r,rrr-rPr"�ndarrayrErGrHrIrMrJ�staticmethodrVrXrYrZrdrnrrrrr.&s�����6768�A���69�'��70���7172���73����7475�	76r.c@szeZdZdZdd�Z		d,dejdeee	dee77e	efde78e	effd	d79�Z
dejdefdd�Zdee	defd
d�Zde80e	efdefdd�Zdedededefdd�Zdejde81e	effdd�Zededededefdd��Zed-dejdedefd d!��Zdejdefd"d#�Zed.dejd%edefd&d'��Zed.dejd%edefd(d)��Zed.dejd%edefd*d+��ZdS)/�SentimentAnalyzerz4Advanced sentiment analyzer for market and news datacCsd|_d|_gd�|_dS)N)�price_momentum�
volume_changer7�rsi�macd�social_sentiment)�sentiment_modelZtext_vectorizer�market_indicatorsrrrrraszSentimentAnalyzer.__init__Nr>�	news_datarrc	82Cs�z.|�|�}|r
|�|�nd}|r|�|�nd}|�|||�}|||||�|�|�|�d�WStyP}ztd|���ddddidd�WYd}~Sd}~ww)aQ83        Analyze overall market sentiment using multiple data sources.84        85        Args:86            market_data: Market price and volume data87            news_data: List of news articles/headlines88            social_data: Social media sentiment data89            90        Returns:91            Dictionary of sentiment scores92        rg)�composite_sentiment�market_sentiment�news_sentimentr��sentiment_indicators�confidence_scorezError in sentiment analysis: rDN)�_analyze_market_sentiment�_analyze_news_sentiment�_analyze_social_sentiment�_calculate_composite_sentiment�_calculate_sentiment_indicators�_calculate_confidence_scorerKrL)	rr>r�rr�r�r�r�rOrrr�analyze_sentimentms693��	���z#SentimentAnalyzer.analyze_sentimentc9495Cs�z^|jrWdSg}|d��}|jdd���jd}|�|�|dd��|d��}|jdd���jd}|�|�|d	d96��|�|�}|�|�|dd��gd
�}tdd�t	||�D��WSt97yx}	ztd|	���WYd}	~	dSd}	~	ww)z"Analyze sentiment from market datargrRrw��windowrT�{�G�z��rsrQg��������r/��F)rg�333333�?r�css�|]	\}}||VqdSr�r)�.0�score�weightrrr�	<genexpr>�s�z>SentimentAnalyzer._analyze_market_sentiment.<locals>.<genexpr>z$Error in market sentiment analysis: N)�emptyrW�rollingr#�ilocrU�_normalize_score�_calculate_rsi�sum�ziprKrL)98rr>�sentiment_scoresr��momentumr�Z	vol_trendr��weightsrOrrrr��s*99100���z+SentimentAnalyzer._analyze_market_sentimentc101Cs�zD|sWdShd�}hd�}d}|D]+}t|�����}t|�|��}t|�|��}||dkr7|||}	nd}	||	7}q|t|�WSty^}102ztd|103���WYd}104~105dSd}106~107ww)z$Analyze sentiment from news articlesrg>�gain�successZrally�growthZprofit>Zfear�loss�riskZcrashZdeclinerz"Error in news sentiment analysis: N)�set�lower�splitr^�intersectionrKrL)rr�Zpositive_wordsZnegative_wordsZtotal_score�text�wordsZpositive_countZnegative_countr�rOrrrr��s(108��z)SentimentAnalyzer._analyze_news_sentimentc109Cs�z6|sWdSg}|��D]\}}|dkr|�|�}n|dkr$|�|�}nd}|�|�q|r4t�|�WSdWStyP}ztd|���WYd}~dSd}~ww)z(Analyze sentiment from social media datargZtwitterZredditz$Error in social sentiment analysis: N)�itemsZ_analyze_twitter_sentimentZ_analyze_reddit_sentimentrUr"r#rKrL)rrr��source�datar�rOrrrr��s"��z+SentimentAnalyzer._analyze_social_sentimentr�r�r�cCs@dddd�}|d||d||d|}tt|d�d	�S)110z&Calculate weighted composite sentimentrgr�r�)�market�news�socialr�r�r�rrS�ru�max)rr�r�r�r��	compositerrrr��s�111112�113��z0SentimentAnalyzer._calculate_composite_sentimentc114Cs�z/i}|jD]&}|dkr|�|�}n|dkr|�|�}n|dkr&|�|�}nd}|||<q|WStyJ}ztd|���iWYd}~Sd}~ww)z&Calculate various sentiment indicatorsr�r�r7rDz(Error calculating sentiment indicators: N)r��_calculate_momentum�_calculate_volume_change�_calculate_volatilityrKrL)rr>�115indicators�	indicator�valuerOrrrr�	s"116117��z1SentimentAnalyzer._calculate_sentiment_indicatorsr��min_val�max_valcCs,ztt||||d�d�WSYdS)z Normalize a value to a 0-1 rangerrSrgr�)r�r�r�rrrr� sz"SentimentAnalyzer._normalize_score�r��periodscCsxz5|d��}|�|dkd�j|d���}|�|dkd�j|d���}||}tddd|jd�WSYdS)�Calculate RSI indicatorrRrr�rrSrT�I@)�diff�wherer�r#rr�)r�r��deltar�r��rsrrrr�(sz SentimentAnalyzer._calculate_rsic118Cs�z&|�|�}|�|�}dt|d�}tt|d�d�}|dd|9}t|�WSty@}ztd|���WYd}~dSd}~ww)	z1Calculate confidence score for sentiment analysisrSrgr�ffffff�?r�z$Error calculating confidence score: NrD)r�r�rur�rrKrL)rr>r7rQrBZ
volume_factorrOrrrr�4s119120121��z-SentimentAnalyzer._calculate_confidence_scorerwr�cC�6z|d��}t|j|d���jd�WSYdS)�Calculate price momentumrRr�rTrD�rWrr�r#r��r�r�r�rrrr�H�122z%SentimentAnalyzer._calculate_momentumcCr�)zCalculate volume trendrQr�rTrDr�)r�r�r�rrrr�Qr�z*SentimentAnalyzer._calculate_volume_changecCr�)zCalculate price volatilityrRr�rTrD)rWrr�r$r�r�rrrr�Zr�z'SentimentAnalyzer._calculate_volatility�NN�r�)rw)r'r(r)r*rr+r,rrr-rrrr�r�r�r�r�r�r�r��intr�r�r�r�r�rrrrr�^sL��123��124125�4���126� r�c@s�eZdZdZdd�Zdejdejfdd�Z	dejde127fdd	�Zddejdede
fd
d�Zddejdede
fdd�Zddejdede
fdd�ZdS)�MarketRegimeClassifierz4Classifier for market regimes using machine learningcCs$tddd�|_t�|_gd�|_dS)Nr0r1��n_componentsr4)Zbear�neutral�bull)�GaussianMixture�modelr	r;�regimesrrrrrfszMarketRegimeClassifier.__init__r>rcCs\g}|d��}|�|��|��|��|��|�|�|�|�|�|�g�t	�128|��dd�S)z3Extract relevant features for regime classificationrRrSrT)rW�extendr#r$�skew�kurtr�r��_calculate_volatility_regimer"r[r\�rr>rr�rrr�extract_featuresks�129z'MarketRegimeClassifier.extract_featurescCs0|�|�}|j�|�}|j�|�d}|j|S)zPredict current market regimer)r�r;rFr�rr�)rr>rrNZ130regime_idxrrr�predict_regime}s131132z%MarketRegimeClassifier.predict_regime�?r�r�cCs"|d��}|j|d���jdS)r�rRr�rT)rWr�r#r�)rr�r�r�rrrr��sz*MarketRegimeClassifier._calculate_momentumr�r�cCsd|d��}|�|dkd�j|d���}|�|dkd�j|d���}||}ddd|jdS)r�rRrr�rrSrT)rWr�r�r#r�)rr�r�r�r�r�r�rrrr��s133z%MarketRegimeClassifier._calculate_rsi�r�cCs$|j|d���t�d�}|jdS)z%Calculate volatility regime indicatorr�r�rT)r�r$r"rpr�)rr�r��volrrrr��s134z3MarketRegimeClassifier._calculate_volatility_regimeN)r�r�)r�)r'r(r)r*rr+r,r"r�r�r-r�r�rr�r��Seriesr�rrrrr�csr�c@s�eZdZdZdejfdd�Zdd�Zdd�Zd	e	j135defd136d�Z	dd	e	j137d
e
eedefdd�Zd	e	j138dejfdd�Zede	j139defdd��Zede	j140defdd��Zd
eedefdd�ZdS)�MLEnhancedAnalyzerz;Enhanced market analyzer with machine learning capabilitiesrcCs@t�d�}|�tj�t��}t�d�}|�|�|�|�|S)u$Configuration du système de loggingZDeepvestz4%(asctime)s - %(name)s - %(levelname)s - %(message)s)�logging�	getLogger�setLevel�INFO�
StreamHandler�	Formatter�setFormatter�141addHandler)r�logger�handler�	formatterrrr�
_setup_logger�s142143144145z MLEnhancedAnalyzer._setup_loggercCst�|_|��|_dSr�)r��regime_classifier�_initialize_sentiment_model�sentiment_analyzerrrrrr�s�MLEnhancedAnalyzer.__init__cCstddd�S)Nrr1r�)r�rrrrr�sz.MLEnhancedAnalyzer._initialize_sentiment_modelr>cCs|j�|�S)zPredict market regime)rr�)rr>rrr�predict_market_regime�sz(MLEnhancedAnalyzer.predict_market_regimeNr�cCs@|�|�}|j�|�}|r|�|�}d|d|}t|���S)zAnalyze market sentimentr�r�)�_extract_market_featuresr�
predict_probar�rr#)rr>r�Zmarket_features�sentiment_scorer�rrr�analyze_market_sentiment�s146147z+MLEnhancedAnalyzer.analyze_market_sentimentcCs~|jr148t�dgg�Sg}|d����}|�|��|��|��|�	�g�|�|�149|�|�|�|�|�g�t�|��
dd�S)z'Extract features for sentiment analysisrrRrSrT)r�r"r[rW�dropnar�r#r$r�r��_calculate_macdr��_calculate_bollinger_bandsr\r�rrrr�s ��z+MLEnhancedAnalyzer._extract_market_featuresr�cCs\d|jvst|�dkr
dS|djddd���}|djddd���}||}t|jd�S)zCalculate MACD indicatorrR�rDr�F��span�adjustrT)�columnsr^�ewmr#rr�)r��exp1�exp2r�rrrr�s�"MLEnhancedAnalyzer._calculate_macdcCs|d|jvst|�dkr
dS|djdd���}|djdd���}||d}||d}|d|||}t|jd�S)z"Calculate Bollinger Bands positionrRrwrDr�rrT)rr^r�r#r$rr�)r��mar$�upperr��positionrrrr�sz-MLEnhancedAnalyzer._calculate_bollinger_bandscCsdS)z&Simple sentiment analysis of news datargr)rr�rrrr��sz*MLEnhancedAnalyzer._analyze_news_sentimentr�)r'r(r)r*r��Loggerrrrr+r,r-r150rrrrr"r�rr�rrr�rrrrr��s(151��152�153�	r�c@s8eZdZdZdd�Z		d!dejdeee	dee154de155e	effd	d156�Zdejde
jfdd�Zd
e
jde	fdd�Zdejde157e	effdd�Zdee	de158e	effdd�Zdejde159e	effdd�Zde160de161e	effdd�Zed"dejdedefdd��Zedejdefdd��Zede162e	effdd ��ZdS)#r�z*ML-enhanced market analysis implementationcCs@tddd�|_tddd�|_t�|_t�d�|_t	�d�|_163dS)Nrr1)rr4z<nickmuchi/finbert-tone-finetuned-finance-text-classification)rrrZrisk_predictorr	r;r164�from_pretrained�sentiment_tokenizerrr�rrrrr�s165r	Nr>r��alternative_datarc166�s��z;|�|�}|j�|�}|�|�}|�|�}|�|�}i}	|r(|�|�IdH}	i}167|r1|�|�}168||||	|169t�	�d�WSt170y[}ztdt|����|�
�WYd}~Sd}~ww)u8Analyse complète des conditions de marché utilisant MLN�r|rC�technical_metrics�	sentimentZalternative_insights�	timestampzError in ML market analysis: )�_prepare_featuresr;rF�_predict_market_regime�_analyze_risk_factors�_analyze_technical_factors�_analyze_sentiment�_analyze_alternative_datar�nowrKrLr-�_get_default_analysis)rr>r�r!rrNr|rCr#r$Zalt_insightsrOrrr�analyze_market_conditions�s2�171172173174175�	��z,MLEnhancedAnalyzer.analyze_market_conditionsc176Cs177zdd|jvr
|����}n|d��}g}|�|��|��|��|��|dk��g�d|jvrJ|d}|�|��|��|��|��dk��g�d|jvr[|d}|�|�|��t	�178|��dd�WSty�}zt
dt|����t	�d�WYd	}~Sd	}~ww)179u'Prépare les features pour l'analyse MLr�rrQrRrSrTzError preparing features: )rS�180N)rrWrr�r#r$r��kurtosisZ_calculate_technical_featuresr"r[r\rKrLr-r])rr>r�rrQ�close_pricesrOrrrr&#s8181182�183	�184��z$MLEnhancedAnalyzer._prepare_featuresrc185Csrz|j�|�d}gd�}t|ttjf�r||WSdWSty8}ztdt|����WYd}~dSd}~ww)u$Prédit le régime de marché actuelr)�BULL_MARKET�BEAR_MARKET�HIGH_VOLATILITY�LOW_VOLATILITYr5zError predicting regime: N)	rrr�r�r"�integerrKrLr-)rr�186predictionr�rOrrrr'Ks ��z)MLEnhancedAnalyzer._predict_market_regimec187Cs�z+|����}t|��t�d��|�|�tt�|d��t|���t|�	��d�}|WSt188yN}ztdt|����ddddd	d�WYd189}~Sd190}~ww)zAnalyse des facteurs de risquer��)r7�	tail_risk�var_95�skewnessr0zError analyzing risk factors: �333333�?rrr�rDg@N)
rWrrr$r"rp�_calculate_tail_risk�191percentiler�r0rKrLr-)rr>r�rCrOrrrr(Us&192193����z(MLEnhancedAnalyzer._analyze_risk_factorsc194195�s��zYg}|D]:}|j|dddd�}t���#|jdi|��}|j}tj|dd�}|�|��d�Wd�n1s;wYqtj	|dd�}t196|d	�t197|d�t198|d�d199�WSty{}	ztdt
|	����dd
dd200�WYd}	~	Sd}	~	ww)z"Analyse du sentiment des nouvelles�ptT)Zreturn_tensors�padding�201truncationrS)�dimrN)�axisr��positiver��negativezError analyzing sentiment: ���Q��?���(\���?r)r �torch�no_gradr��logits�softmaxrU�tolistr"r#rrKrLr-)202rr�Z203sentimentsr��inputs�outputsrK�probsZ
avg_sentimentrOrrrr*ns,�204��205206207���z%MLEnhancedAnalyzer._analyze_sentimentc208Csvz|d}|�|�|�|�|�|�|�|�d�WSty:}ztdt|����ddddd�WYd}~Sd}~ww)zAnalyse des facteurs techniquesrR)r�r�r�r!z#Error analyzing technical factors: r�rDN)r�rr��_calculate_trend_strengthrKrLr-)rr>r1rOrrrr)�s ����z-MLEnhancedAnalyzer._analyze_technical_factorsc209Cs�i}z-d|vr|�|d�|d<d|vr|�|d�|d<d|vr-|�|d�|d<W|SW|StyK}ztdt|����WYd}~|Sd}~ww)u!Analyse des données alternativesZsocial_mediar�Zweb_trafficZtrafficZ	satellitez"Error analyzing alternative data: N)Z_analyze_social_dataZ_analyze_web_trafficZ_analyze_satellite_datarKrLr-)rr!ZinsightsrOrrrr+�s ����z,MLEnhancedAnalyzer._analyze_alternative_datar��pricesr�cCs|z3|��}|�|dkd�j|d���}|�|dkd�j|d���}||}tddd|jd�WSty=YdSw)z
Calcul du RSIrr�rrSrTr�)r�r�r�r#rr�rK)rRr�r�r�r�r�rrrr��s�z!MLEnhancedAnalyzer._calculate_rsicCsnz,|jddd���}|jddd���}||}|jddd���}t|jd|jd�WSty6YdSw)zCalcul du MACDr�Frr�	rTrD)rr#rr�rK)rRrrr��signalrrrr�s�rcCs.ddddd�dddd�d	d210d	d�it��d�S)
u0Retourne une analyse par défaut en cas d'erreurr5r<rrr�)r7r9r:r�rD)r�r�r�rGrHrDr")rr,rrrrr-�s ����z(MLEnhancedAnalyzer._get_default_analysisr�r�)r'r(r)r*rr+r,rrr-rrr.r"r�r&r'rr(r*r)r+r�r�r�r�rr-rrrrr��s4��211��212213�*(214)�numpyr"�pandasr+�typingrrrrr�sklearn.ensemblerrZsklearn.preprocessingr	rI�torch.nn�nnr��transformersr215r�216core.typesr
rr.r�r�r�rrrr�<module>s*:3V