





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





def       lowercase_      (		lowercase__				,  lowercase__				,  lowercase__						)   ->np.ndarray:
						_snake_case:   int  					=		XGBRegressor(verbosity=0				,  random_state=42						)
						xgb.fit(lowercase__				,  lowercase__						)
						# Predict target for test data
						_snake_case:   Tuple  					=		xgb.predict(lowercase__						)
						_snake_case:   Union[str, Any]  					=		predictions.reshape(len(lowercase__						)				,  1						)
						return predictions





def       lowercase_      (		)   ->None:
						_snake_case:   List[str]  					=		fetch_california_housing()
						_snake_case					,						_snake_case:   Optional[Any]  					=		data_handling(lowercase__						)
						_snake_case					,						_snake_case					,						_snake_case					,						_snake_case:   Tuple  					=		train_test_split(
						    lowercase__				,  lowercase__				,  test_size=0.2_5				,  random_state=1						)
						_snake_case:   Union[str, 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()












'''simple docstring'''






A   : List[str]             =			'\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n'

A   : List[str]             =			[{'type': 'code', 'content': INSTALL_CONTENT}]
A   : Dict             =			{
    '{processor_class}': 'FakeProcessorClass',
    '{model_class}': 'FakeModelClass',
    '{object_class}': 'FakeObjectClass',
}





