


'''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_     (       A__   :  dict   ):
  '''simple docstring'''





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







def 							UpperCamelCase_     (       A__   :  np.ndarray				,       A__   :  np.ndarray				,       A__   :  np.ndarray   ):
  '''simple docstring'''





  lowerCAmelCase_     : str     =  XGBRegressor(verbosity=0				,       random_state=42   )
  xgb.fit(A__				,       A__   )
  # Predict target for test data
  lowerCAmelCase_     : Optional[int]     =  xgb.predict(A__   )
  lowerCAmelCase_     : Union[str, Any]     =  predictions.reshape(len(A__   )				,       1   )
  return predictions







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : str     =  fetch_california_housing()
  lowerCAmelCase_,				lowerCAmelCase_     : List[str]     =  data_handling(A__   )
  lowerCAmelCase_,				lowerCAmelCase_,				lowerCAmelCase_,				lowerCAmelCase_     : Dict     =  train_test_split(
      A__				,       A__				,       test_size=0.25				,       random_state=1   )
  lowerCAmelCase_     : Dict     =  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()







'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


__A   :    str											= {
    "configuration_audio_spectrogram_transformer": [
        "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ASTConfig",
    ]
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A   :    List[str]											= [
      "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
      "ASTForAudioClassification",
      "ASTModel",
      "ASTPreTrainedModel",
  ]

try:
  if not is_speech_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A   :    Union[str, Any]											= ["ASTFeatureExtractor"]

if TYPE_CHECKING:
  from .configuration_audio_spectrogram_transformer import (
      AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      ASTConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_audio_spectrogram_transformer import (
        AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        ASTForAudioClassification,
        ASTModel,
        ASTPreTrainedModel,
    )

  try:
    if not is_speech_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
  import sys

  __A   :    List[Any]											= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



