


import numpy as np
from sklearn.datasets import fetch_california_housing
from sklearn.metrics import mean_absolute_error, mean_squared_error
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor







def 			SCREAMING_SNAKE_CASE_		(     __A					:     dict							)      ->						tuple:

       """simple docstring"""

       return (data["data"], data["target"])







def 			SCREAMING_SNAKE_CASE_		(     __A					:     np.ndarray    ,       __A					:     np.ndarray    ,       __A					:     np.ndarray							)      ->						np.ndarray:

       """simple docstring"""

       a_   :						List[str]				=    XGBRegressor(verbosity=0    ,       random_state=42							)
       xgb.fit(__UpperCamelCase    ,       __UpperCamelCase							)
       # Predict target for test data
       a_   :						Union[str, Any]				=    xgb.predict(__UpperCamelCase							)
       a_   :						Dict				=    predictions.reshape(len(__UpperCamelCase							)    ,       1							)
       return predictions







def 			SCREAMING_SNAKE_CASE_		(     )      ->						None:

       """simple docstring"""

       a_   :						List[Any]				=    fetch_california_housing()
       a_				,						a_   :						Tuple				=    data_handling(__UpperCamelCase							)
       a_				,						a_				,						a_				,						a_   :						str				=    train_test_split(
           __UpperCamelCase    ,       __UpperCamelCase    ,       test_size=0.25    ,       random_state=1							)
       a_   :						str				=    xgboost(__UpperCamelCase    ,       __UpperCamelCase    ,       __UpperCamelCase							)
       # Error printing
       print(F"""Mean Absolute Error : {mean_absolute_error(__UpperCamelCase    ,       __UpperCamelCase							)}"""							)
       print(F"""Mean Square Error  : {mean_squared_error(__UpperCamelCase    ,       __UpperCamelCase							)}"""							)


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()






'''simple docstring'''
from __future__ import annotations

def 					lowerCamelCase_ ( __UpperCamelCase					:       list							,    __UpperCamelCase					:       int | None = None							,    __UpperCamelCase					:       int | None = None		)					->	None:







     """simple docstring"""
     if start is None:
          _A				=							0

     if end is None:
          _A				=							len(__UpperCamelCase		) - 1

     if start >= end:
          return

     _A				=							(start + end) // 2

     slowsort(__UpperCamelCase							,    __UpperCamelCase							,    __UpperCamelCase		)
     slowsort(__UpperCamelCase							,    mid + 1							,    __UpperCamelCase		)

     if sequence[end] < sequence[mid]:
          _A		,				_A				=							sequence[mid], sequence[end]

     slowsort(__UpperCamelCase							,    __UpperCamelCase							,    end - 1		)


if __name__ == "__main__":
    from doctest import testmod

    testmod()





