'''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    __UpperCAmelCase			(  a_:       dict							):
   return (data["data"], data["target"])






def    __UpperCAmelCase			(  a_:       np.ndarray,					a_:       np.ndarray,					a_:       np.ndarray							):
   _UpperCAmelCase							:	Tuple							=   XGBRegressor(verbosity=0,					random_state=42							)
   xgb.fit(snake_case_,					snake_case_							)
   # Predict target for test data
   _UpperCAmelCase							:	str							=   xgb.predict(snake_case_							)
   _UpperCAmelCase							:	Dict							=   predictions.reshape(len(snake_case_							),					1							)
   return predictions






def    __UpperCAmelCase			(  ):
   _UpperCAmelCase							:	Any							=   fetch_california_housing()
   _UpperCAmelCase							,       _UpperCAmelCase							:	Optional[Any]							=   data_handling(snake_case_							)
   _UpperCAmelCase							,       _UpperCAmelCase							,       _UpperCAmelCase							,       _UpperCAmelCase							:	Union[str, Any]							=   train_test_split(
       snake_case_,					snake_case_,					test_size=0.25,					random_state=1							)
   _UpperCAmelCase							:	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()






def lowerCamelCase__    (							snake_case_	:  int       )      ->				int:
   if not isinstance(snake_case_       ,      snake_case_       ) or number < 0:
      raise ValueError('''Input must be a non-negative integer'''       )

   __snake_case							       =   0
   while number:
      # This way we arrive at next set bit (next 1) instead of looping
      # through each bit and checking for 1s hence the
      # loop won't run 32 times it will only run the number of `1` times
      number &= number - 1
      count += 1
   return count


if __name__ == "__main__":
    import doctest

    doctest.testmod()

