




'''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      UpperCamelCase_(	snake_case							:       dict     ):

							'''simple docstring'''






							return (data["data"], data["target"])


def      UpperCamelCase_(	snake_case							:       np.ndarray							,				snake_case							:       np.ndarray							,				snake_case							:       np.ndarray     ):

							'''simple docstring'''






							snake_case_						=      XGBRegressor(verbosity=0							,				random_state=4_2     )
							xgb.fit(lowercase_							,				lowercase_     )
							# Predict target for test data
							snake_case_						=      xgb.predict(lowercase_     )
							snake_case_						=      predictions.reshape(len(lowercase_     )							,				1     )
							return predictions


def      UpperCamelCase_(	):

							'''simple docstring'''






							snake_case_						=      fetch_california_housing()
							snake_case_						=      data_handling(lowercase_     )
							snake_case_						=      train_test_split(
							    lowercase_							,				lowercase_							,				test_size=0.25							,				random_state=1     )
							snake_case_						=      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()







from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_       : int         =			logging.get_logger(__name__)

A_       : Optional[Any]         =			{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}



class     _a						(__magic_name__				):


					'''simple docstring'''






					UpperCAmelCase__:   List[Any]  							=       '''mgp-str'''






					def __init__( self    ,       A__=[32, 128]    ,       A__=4    ,       A__=3    ,       A__=27    ,       A__=38    ,       A__=5_0257    ,       A__=3_0522    ,       A__=768    ,       A__=12    ,       A__=12    ,       A__=4.0    ,       A__=True    ,       A__=False    ,       A__=1e-5    ,       A__=0.0    ,       A__=0.0    ,       A__=0.0    ,       A__=False    ,       A__=0.0_2    ,       **A__    ,       ):
						super().__init__(**A__			)

						A__							:    Dict        =		image_size
						A__							:    int        =		patch_size
						A__							:    Dict        =		num_channels
						A__							:    List[Any]        =		max_token_length
						A__							:    str        =		num_character_labels
						A__							:    Tuple        =		num_bpe_labels
						A__							:    Optional[Any]        =		num_wordpiece_labels
						A__							:    Optional[int]        =		hidden_size
						A__							:    Tuple        =		num_hidden_layers
						A__							:    Any        =		num_attention_heads
						A__							:    List[Any]        =		mlp_ratio
						A__							:    Tuple        =		distilled
						A__							:    Union[str, Any]        =		layer_norm_eps
						A__							:    Tuple        =		drop_rate
						A__							:    List[str]        =		qkv_bias
						A__							:    Optional[Any]        =		attn_drop_rate
						A__							:    Union[str, Any]        =		drop_path_rate
						A__							:    Optional[Any]        =		output_aa_attentions
						A__							:    Optional[int]        =		initializer_range



