


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						(							snake_case	:    dict )       ->							tuple:
   return (data["data"], data["target"])



def     __lowerCAmelCase						(							snake_case	:    np.ndarray						,      snake_case	:    np.ndarray						,      snake_case	:    np.ndarray )       ->							np.ndarray:
   __lowerCamelCase:				List[Any]     =	XGBRegressor(verbosity=0						,      random_state=42 )
   xgb.fit(snake_case						,      snake_case )
   # Predict target for test data
   __lowerCamelCase:				Optional[int]     =	xgb.predict(snake_case )
   __lowerCamelCase:				List[str]     =	predictions.reshape(len(snake_case )						,      1 )
   return predictions



def     __lowerCAmelCase						(							)       ->							None:
   __lowerCamelCase:				Dict     =	fetch_california_housing()
   __lowerCamelCase:				Union[str, Any]     =	data_handling(snake_case )
   __lowerCamelCase:				Optional[int]     =	train_test_split(
       snake_case						,      snake_case						,      test_size=0.25						,      random_state=1 )
   __lowerCamelCase:				List[Any]     =	xgboost(snake_case						,      snake_case						,      snake_case )
   # Error printing
   print(f'Mean Absolute Error : {mean_absolute_error(snake_case						,      snake_case )}' )
   print(f'Mean Square Error  : {mean_squared_error(snake_case						,      snake_case )}' )


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()






import math



def     __lowerCAmelCase						(							snake_case	:    int )       ->							bool:
   __lowerCamelCase:				Dict     =	math.loga(math.sqrt(4 * positive_integer + 1 ) / 2 + 1 / 2 )

   return exponent == int(snake_case )



def     __lowerCAmelCase						(							snake_case	:    float = 1 / 12345 )       ->							int:
   __lowerCamelCase:				str     =	0
   __lowerCamelCase:				Optional[Any]     =	0

   __lowerCamelCase:				str     =	3
   while True:
      __lowerCamelCase:				int     =	(integer**2 - 1) / 4
      # if candidate is an integer, then there is a partition for k
      if partition_candidate == int(snake_case ):
         __lowerCamelCase:				Union[str, Any]     =	int(snake_case )
         total_partitions += 1
         if check_partition_perfect(snake_case ):
            perfect_partitions += 1
      if perfect_partitions > 0:
         if perfect_partitions / total_partitions < max_proportion:
            return int(snake_case )
      integer += 1


if __name__ == "__main__":
   print(F"""{solution() = }""")


