




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






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






def 		UpperCamelCase__      (		)    ->   None:
      snake_case__       :   Dict	      =    fetch_california_housing()
      snake_case__       :   Any	      =    data_handling(__lowerCAmelCase		)
      snake_case__       :   str	      =    train_test_split(
          __lowerCAmelCase				,      __lowerCAmelCase				,      test_size=0.25				,      random_state=1		)
      snake_case__       :   int	      =    xgboost(__lowerCAmelCase				,      __lowerCAmelCase				,      __lowerCAmelCase		)
      # Error printing
      print(f"Mean Absolute Error : {mean_absolute_error(__lowerCAmelCase				,      __lowerCAmelCase		)}"		)
      print(f"Mean Square Error  : {mean_squared_error(__lowerCAmelCase				,      __lowerCAmelCase		)}"		)


if __name__ == "__main__":
      import doctest

      doctest.testmod(verbose=True)
      main()





from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

_lowerCamelCase    :		Dict		      =    typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
_lowerCamelCase    :		Any		      =    typing.Union[np.floataa, int, float]  # noqa: UP007

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase   )     ->     VectorOut:
					return np.sqrt(np.sum((np.asarray(__lowerCAmelCase   ) - np.asarray(__lowerCAmelCase   )) ** 2   )   )

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase   )     ->     VectorOut:
					return sum((va - va) ** 2 for va, va in zip(__lowerCAmelCase      ,	__lowerCAmelCase   )   ) ** (1 / 2)


if __name__ == "__main__":

			def        __a			(   )     ->     None:
								from timeit import timeit

								print('Without Numpy'   )
								print(
								    timeit(
								        'euclidean_distance_no_np([1, 2, 3], [4, 5, 6])'      ,	number=1_0000      ,	globals=globals()      ,	)   )
								print('With Numpy'   )
								print(
								    timeit(
								        'euclidean_distance([1, 2, 3], [4, 5, 6])'      ,	number=1_0000      ,	globals=globals()      ,	)   )



			benchmark()