




'''simple docstring'''







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__				(      __lowercase				):
     return (data["data"], data["target"])



def        lowerCamelCase__				(      __lowercase     ,   __lowercase     ,   __lowercase				):
     snake_case			:      Optional[Any]        =			XGBRegressor(verbosity=0     ,   random_state=42				)
     xgb.fit(__lowercase     ,   __lowercase				)
     # Predict target for test data
     snake_case			:      Union[str, Any]        =			xgb.predict(__lowercase				)
     snake_case			:      Optional[int]        =			predictions.reshape(len(__lowercase				)     ,   1				)
     return predictions



def        lowerCamelCase__				(      ):
     snake_case			:      Union[str, Any]        =			fetch_california_housing()
     snake_case ,		snake_case			:      Any        =			data_handling(__lowercase				)
     snake_case ,		snake_case ,		snake_case ,		snake_case			:      Optional[Any]        =			train_test_split(
         __lowercase     ,   __lowercase     ,   test_size=0.25     ,   random_state=1				)
     snake_case			:      Optional[Any]        =			xgboost(__lowercase     ,   __lowercase     ,   __lowercase				)
     # Error printing
     print(F'''Mean Absolute Error : {mean_absolute_error(__lowercase     ,   __lowercase				)}'''				)
     print(F'''Mean Square Error  : {mean_squared_error(__lowercase     ,   __lowercase				)}'''				)


if __name__ == "__main__":
      import doctest

      doctest.testmod(verbose=True)
      main()









'''simple docstring'''







def        lowerCamelCase__				(      __lowercase				):
     if not isinstance(__lowercase     ,   __lowercase				):
          snake_case			:      int        =			F'''Input value of [number={number}] must be an integer'''
          raise TypeError(__lowercase				)
     if number < 0:
          return False
     snake_case			:      Optional[int]        =			number * number
     while number > 0:
          if number % 10 != number_square % 10:
               return False
          number //= 10
          number_square //= 10
     return True


if __name__ == "__main__":
      import doctest

      doctest.testmod()



