



'''simple docstring'''

def      __lowerCamelCase     (      lowerCAmelCase_  )			->      int:
		_a     :      Optional[int]        =							hex_num.strip()
		if not hex_num:
				raise ValueError('No value was passed to the function'  )

		_a     :      Dict        =							hex_num[0] == '-'
		if is_negative:
				_a     :      Optional[int]        =							hex_num[1:]

		try:
				_a     :      Optional[Any]        =							int(lowerCAmelCase_						,			16  )
		except ValueError:
				raise ValueError('Invalid value was passed to the function'  )

		_a     :      int        =							''
		while int_num > 0:
				_a     :      Union[str, Any]        =							str(int_num % 2  ) + bin_str
				int_num >>= 1

		return int(('-' + bin_str) if is_negative else bin_str  )


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

def      A      (      _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )	-> np.ndarray:
       lowerCamelCase   :      List[str]			 =					XGBRegressor(verbosity=0 ,random_state=42    )
       xgb.fit(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )
       # Predict target for test data
       lowerCamelCase   :      List[Any]			 =					xgb.predict(_SCREAMING_SNAKE_CASE    )
       lowerCamelCase   :      Tuple			 =					predictions.reshape(len(_SCREAMING_SNAKE_CASE    ) ,1    )
       return predictions

def      A      (      )	-> None:
       lowerCamelCase   :      Dict			 =					fetch_california_housing()
       lowerCamelCase ,      lowerCamelCase   :      Tuple			 =					data_handling(_SCREAMING_SNAKE_CASE    )
       lowerCamelCase ,      lowerCamelCase ,      lowerCamelCase ,      lowerCamelCase   :      Optional[Any]			 =					train_test_split(
           _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE ,test_size=0.25 ,random_state=1    )
       lowerCamelCase   :      Any			 =					xgboost(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )
       # Error printing
       print(f'''Mean Absolute Error : {mean_absolute_error(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )}'''    )
       print(f'''Mean Square Error  : {mean_squared_error(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )}'''    )


if __name__ == "__main__":
       import doctest

       doctest.testmod(verbose=True)
       main()






