




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



def 					a__				(       snake_case__ ,				snake_case__ ,				snake_case__       )		->      np.ndarray:
			lowerCamelCase       =      XGBRegressor(verbosity=0 ,				random_state=42       )
			xgb.fit(snake_case__ ,				snake_case__       )
			# Predict target for test data
			lowerCamelCase       =      xgb.predict(snake_case__       )
			lowerCamelCase       =      predictions.reshape(len(snake_case__       ) ,				1       )
			return predictions



def 					a__				(       )		->      None:
			lowerCamelCase       =      fetch_california_housing()
			lowerCamelCase   ,     lowerCamelCase       =      data_handling(snake_case__       )
			lowerCamelCase   ,     lowerCamelCase   ,     lowerCamelCase   ,     lowerCamelCase       =      train_test_split(
			    snake_case__ ,				snake_case__ ,				test_size=0.25 ,				random_state=1       )
			lowerCamelCase       =      xgboost(snake_case__ ,				snake_case__ ,				snake_case__       )
			# Error printing
			print(F'Mean Absolute Error : {mean_absolute_error(snake_case__ ,				snake_case__       )}'       )
			print(F'Mean Square Error  : {mean_squared_error(snake_case__ ,				snake_case__       )}'       )


if __name__ == "__main__":
					import doctest

					doctest.testmod(verbose=True)
					main()









"""simple docstring"""




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


lowerCAmelCase							:    Dict  							=							logging.get_logger(__name__)

lowerCAmelCase							:    Optional[Any]  							=							{
    """MIT/ast-finetuned-audioset-10-10-0.4593""": (
        """https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json"""
    ),
}






class 					__magic_name__							( UpperCAmelCase__       ):






				'''simple docstring'''
				__UpperCamelCase    						=		"audio-spectrogram-transformer"





				def __init__( self	,				_a=768	,				_a=12	,				_a=12	,				_a=3_072	,				_a="gelu"	,				_a=0.0	,				_a=0.0	,				_a=0.02	,				_a=1e-1_2	,				_a=16	,				_a=True	,				_a=10	,				_a=10	,				_a=1_024	,				_a=128	,				**_a	,				):





							"""simple docstring"""
							super().__init__(**_a				)

							lowerCamelCase       =      hidden_size
							lowerCamelCase       =      num_hidden_layers
							lowerCamelCase       =      num_attention_heads
							lowerCamelCase       =      intermediate_size
							lowerCamelCase       =      hidden_act
							lowerCamelCase       =      hidden_dropout_prob
							lowerCamelCase       =      attention_probs_dropout_prob
							lowerCamelCase       =      initializer_range
							lowerCamelCase       =      layer_norm_eps
							lowerCamelCase       =      patch_size
							lowerCamelCase       =      qkv_bias
							lowerCamelCase       =      frequency_stride
							lowerCamelCase       =      time_stride
							lowerCamelCase       =      max_length
							lowerCamelCase       =      num_mel_bins



