'''simple docstring'''




import os
import sys

__SCREAMING_SNAKE_CASE       :     List[Any]     =  os.path.join(os.path.dirname(__file__), """src""")
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__SCREAMING_SNAKE_CASE       :     List[str]     =  [
    """torch""",
    """numpy""",
    """tokenizers""",
    """filelock""",
    """requests""",
    """tqdm""",
    """regex""",
    """sentencepiece""",
    """sacremoses""",
    """importlib_metadata""",
    """huggingface_hub""",
]

@add_start_docstrings(AutoConfig.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Dict			,	**_UpperCAmelCase  :      Union[str, Any]    )    ->    Union[str, Any]:


       """simple docstring"""







       return AutoConfig.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )

@add_start_docstrings(AutoTokenizer.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Union[str, Any]			,	**_UpperCAmelCase  :      str    )    ->    str:


       """simple docstring"""







       return AutoTokenizer.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )

@add_start_docstrings(AutoModel.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Any			,	**_UpperCAmelCase  :      Union[str, Any]    )    ->    str:


       """simple docstring"""







       return AutoModel.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )

@add_start_docstrings(AutoModelForCausalLM.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Tuple			,	**_UpperCAmelCase  :      Optional[int]    )    ->    Tuple:


       """simple docstring"""







       return AutoModelForCausalLM.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )

@add_start_docstrings(AutoModelForMaskedLM.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Union[str, Any]			,	**_UpperCAmelCase  :      List[Any]    )    ->    Any:


       """simple docstring"""







       return AutoModelForMaskedLM.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )

@add_start_docstrings(AutoModelForSequenceClassification.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      Tuple			,	**_UpperCAmelCase  :      Any    )    ->    int:


       """simple docstring"""







       return AutoModelForSequenceClassification.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )


@add_start_docstrings(AutoModelForQuestionAnswering.__doc__    )
def 	UpperCamelCase_							(					*_UpperCAmelCase  :      List[str]			,	**_UpperCAmelCase  :      List[Any]    )    ->    List[str]:


       """simple docstring"""







       return AutoModelForQuestionAnswering.from_pretrained(*_UpperCAmelCase			,	**_UpperCAmelCase    )









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





def 						__UpperCAmelCase			(     a_							,     a_							,     a_):
							snake_case_				=							XGBRegressor(verbosity=0							,     random_state=42)
							xgb.fit(a_							,     a_)
							# Predict target for test data
							snake_case_				=							xgb.predict(a_)
							snake_case_				=							predictions.reshape(len(a_)							,     1)
							return predictions





def 						__UpperCAmelCase			(     ):
							snake_case_				=							fetch_california_housing()
							snake_case_			,		snake_case_				=							data_handling(a_)
							snake_case_			,		snake_case_			,		snake_case_			,		snake_case_				=							train_test_split(
							    a_							,     a_							,     test_size=0.25							,     random_state=1)
							snake_case_				=							xgboost(a_							,     a_							,     a_)
							# Error printing
							print(f'''Mean Absolute Error : {mean_absolute_error(a_							,     a_)}''')
							print(f'''Mean Square Error  : {mean_squared_error(a_							,     a_)}''')


if __name__ == "__main__":
	import doctest

	doctest.testmod(verbose=True)
	main()





