ó
    uñ:iW  ã                   ó"  • S r SSKJr  SSKrSSKJr  SSKJrJ	r	  S\R                  S\4S	 jrS\R                  S\4S
 jr SS\S\\   S\4S jjrSr\R                   R!                  \S9r\R                   R!                  \S9r\R&                  " \\45      r\R                   R+                  SS\S9rS\-  \R.                  " S\R0                  -  \-  5      -   S\-  -
  \R2                  " S\R0                  -  \-  5      -
  \-   r\	" \\S9rg)z)Helpers for testing monotone constraints.é    )ÚOptionalNé   )ÚFeatureNames)ÚBoosterÚDMatrixÚvÚreturnc                 ób   • [         R                  " [         R                  " U 5      S:  5      S:H  $ )zWhether is v increasing.ç        r   ©ÚnpÚcount_nonzeroÚdiff©r   s    Úg/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/xgboost/testing/monotone_constraints.pyÚis_increasingr      ó%   € ä×ÒœBŸGšG A›J¨Ñ,Ó-°Ñ2Ð2ó    c                 ób   • [         R                  " [         R                  " U 5      S:„  5      S:H  $ )zWhether is v decreasing.r   r   r   r   s    r   Úis_decreasingr      r   r   ÚlearnerÚfeature_namesc                 óð  • Sn[         R                  " SSU5      R                  US45      n[         R                  " SSU5      n[        U5       H¤  nXE   [         R                  " US45      -  n[         R
                  " X645      n[        XqS9nU R                  U5      n	[         R
                  " Xc45      n
[        X¡S9nU R                  U5      n[        U	5      (       a  [        U5      (       a  M¤    g   g)z5Whether the monotone constraint is correctly applied.éd   r   é   )r   FT)
r   ÚlinspaceÚreshapeÚrangeÚonesÚcolumn_stackr   Úpredictr   r   )r   r   ÚnÚ
variable_xÚfixed_xs_valuesÚiÚfixed_xÚmonotonically_increasing_xÚmonotonically_increasing_dsetÚmonotonically_increasing_yÚmonotonically_decreasing_xÚmonotonically_decreasing_dsetÚmonotonically_decreasing_ys                r   Úis_correctly_constrainedr-      sé   € ð 	€AÜ—’˜Q  1Ó%×-Ñ-¨q°!¨fÓ5€JÜ—k’k ! Q¨Ó*€Oä�1ŽXˆØ!Ñ$¤r§w¢w°°1¨v£Ñ6ˆÜ%'§_¢_°jÐ5JÓ%KÐ"Ü(/Ø&ñ)
Ð%ð &-§_¡_Ð5RÓ%SÐ"ä%'§_¢_°gÐ5JÓ%KÐ"Ü(/Ø&ñ)
Ð%ð &-§_¡_Ð5RÓ%SÐ"ô Ð4×5Ñ5ÜÐ8×9Ó9áñ% ð( r   iè  )Úsizer   g{®Gáz„?)ÚlocÚscaler.   é   é
   )Úlabel)N)Ú__doc__Útypingr   Únumpyr   Ú_typingr   Úcorer   r   ÚndarrayÚboolr   r   r-   ÚNUMBER_OF_DPOINTSÚrandomÚx1_positively_correlated_with_yÚx2_negatively_correlated_with_yr    ÚxÚnormalÚzsÚsinÚpiÚcosÚyÚtraining_dset© r   r   Ú<module>rH      sI  ðÙ /å ã å "ß #ð3�R—Z‘Zð 3 Dô 3ð
3�R—Z‘Zð 3 Dô 3ð ?CñØðØ%-¨lÑ%;ðà	õð> Ð Ø"$§)¡)×"2Ñ"2Ð8IÐ"2Ð"JÐ Ø"$§)¡)×"2Ñ"2Ð8IÐ"2Ð"JÐ à‡O‚OÐ4Ð6UÐVÓW€Ø‡Y�Y×Ñ˜# TÐ0AÐÐB€àÐ'Ñ'Ø‡f‚fˆR�"—%‘%‰ZÐ9Ñ9Ó:ñ;àÐ
)Ñ)ñ*ð 	‡f‚fˆR�"—%‘%‰ZÐ9Ñ9Ó:ñ;ð 	ñ		ð ñ ˜ Ñ#�r   