





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 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE				)							-> tuple:




    """simple docstring"""




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





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)							-> np.ndarray:




    """simple docstring"""




    _A     =							XGBRegressor(verbosity=0							,     random_state=42				)
    xgb.fit(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)
    # Predict target for test data
    _A     =							xgb.predict(_SCREAMING_SNAKE_CASE				)
    _A     =							predictions.reshape(len(_SCREAMING_SNAKE_CASE				)							,     1				)
    return predictions





def 				__lowerCAmelCase(       )							-> None:




    """simple docstring"""




    _A     =							fetch_california_housing()
    _A,			_A     =							data_handling(_SCREAMING_SNAKE_CASE				)
    _A,			_A,			_A,			_A     =							train_test_split(
        _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE							,     test_size=0.25							,     random_state=1				)
    _A     =							xgboost(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)
    # Error printing
    print(F"Mean Absolute Error : {mean_absolute_error(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)}"				)
    print(F"Mean Square Error  : {mean_squared_error(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)}"				)


if __name__ == "__main__":
 import doctest

 doctest.testmod(verbose=True)
 main()












def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)							-> float:




    """simple docstring"""




    return price * (1 + tax_rate)


if __name__ == "__main__":
 print(f"{price_plus_tax(100, 0.2_5) = }")
 print(f"{price_plus_tax(1_2_5.5_0, 0.0_5) = }")





