"""simple docstring"""




import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union


@dataclass
class 						a__							:
			A__    :       List[str]        =      None
			A__    :       List[str]        =      False
			A__    :       Any        =      False
			A__    :       List[Any]        =      False
			A__    :       str        =      None
			A__    :       Dict        =      None
			A__    :       Tuple        =      False
			A__    :       Optional[Any]        =      False
			A__    :       str        =      False
			A__    :       Union[str, Any]        =      True
			A__    :       str        =      None
			A__    :       Tuple        =      1
			A__    :       List[str]        =      None
			A__    :       Dict        =      False
			A__    :       Union[str, Any]        =      None
			A__    :       Union[str, Any]        =      None



			def __SCREAMING_SNAKE_CASE							(						self   )			->   Tuple:
								return self.__class__(**{k: copy.deepcopy(lowercase_   ) for k, v in self.__dict__.items()}   )





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(     __lowerCamelCase						):
					return (data["data"], data["target"])
def 							lowerCAmelCase(     __lowerCamelCase				,    __lowerCamelCase				,    __lowerCamelCase						):
					__a		 =       XGBRegressor(verbosity=0				,    random_state=42						)
					xgb.fit(__lowerCamelCase				,    __lowerCamelCase						)
					# Predict target for test data
					__a		 =       xgb.predict(__lowerCamelCase						)
					__a		 =       predictions.reshape(len(__lowerCamelCase						)				,    1						)
					return predictions
def 							lowerCAmelCase(     ):
					__a		 =       fetch_california_housing()
					__a ,				__a		 =       data_handling(__lowerCamelCase						)
					__a ,				__a ,				__a ,				__a		 =       train_test_split(
					    __lowerCamelCase				,    __lowerCamelCase				,    test_size=0.25				,    random_state=1						)
					__a		 =       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()




