




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







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







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







lowerCAmelCase__      				=   [
    '''Audio''',
    '''Array2D''',
    '''Array3D''',
    '''Array4D''',
    '''Array5D''',
    '''ClassLabel''',
    '''Features''',
    '''Sequence''',
    '''Value''',
    '''Image''',
    '''Translation''',
    '''TranslationVariableLanguages''',
]
from .audio import Audio
from .features import ArrayaD, ArrayaD, ArrayaD, ArrayaD, ClassLabel, Features, Sequence, Value
from .image import Image
from .translation import Translation, TranslationVariableLanguages





