





def       SCREAMING_SNAKE_CASE__  (       _lowercase     : int			)   ->							bool:




		'''simple docstring'''
		if not isinstance(_lowercase   ,    _lowercase			):
				lowercase__					:      Union[str, Any]      =		f"""Input value of [number={number}] must be an integer"""
				raise TypeError(_lowercase			)
		if number < 0:
				return False
		lowercase__					:      Optional[Any]      =		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()









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       SCREAMING_SNAKE_CASE__  (       _lowercase     : dict			)   ->							tuple:




		'''simple docstring'''
		return (data["data"], data["target"])


def       SCREAMING_SNAKE_CASE__  (       _lowercase     : np.ndarray   ,    _lowercase     : np.ndarray   ,    _lowercase     : np.ndarray			)   ->							np.ndarray:




		'''simple docstring'''
		lowercase__					:      List[str]      =		XGBRegressor(verbosity=0   ,    random_state=42			)
		xgb.fit(_lowercase   ,    _lowercase			)
		# Predict target for test data
		lowercase__					:      Union[str, Any]      =		xgb.predict(_lowercase			)
		lowercase__					:      Tuple      =		predictions.reshape(len(_lowercase			)   ,    1			)
		return predictions


def       SCREAMING_SNAKE_CASE__  (       )   ->							None:




		'''simple docstring'''
		lowercase__					:      List[str]      =		fetch_california_housing()
		lowercase__   ,				lowercase__					:      Optional[int]      =		data_handling(_lowercase			)
		lowercase__   ,				lowercase__   ,				lowercase__   ,				lowercase__					:      Optional[Any]      =		train_test_split(
		    _lowercase   ,    _lowercase   ,    test_size=0.25   ,    random_state=1			)
		lowercase__					:      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()


