



'''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    lowerCamelCase__ (		_A       ):
  return (data["data"], data["target"])
def    lowerCamelCase__ (		_A				,    _A				,    _A       ):
  a		:      Any       =  XGBRegressor(verbosity=0				,    random_state=42       )
  xgb.fit(_A				,    _A       )
  # Predict target for test data
  a		:      Any       =  xgb.predict(_A       )
  a		:      Any       =  predictions.reshape(len(_A       )				,    1       )
  return predictions
def    lowerCamelCase__ (		):
  a		:      Optional[int]       =  fetch_california_housing()
  a		:      Optional[Any]       =  data_handling(_A       )
  a		:      Dict       =  train_test_split(
      _A				,    _A				,    test_size=0.25				,    random_state=1       )
  a		:      List[str]       =  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 math import factorial, pi
def    lowerCamelCase__ (		_A				,    _A = 30       ):

  if not isinstance(_A				,    (int, float)       ):
    raise ValueError('maclaurin_sin() requires either an int or float for theta'       )

  if not isinstance(_A				,    _A       ) or accuracy <= 0:
    raise ValueError('maclaurin_sin() requires a positive int for accuracy'       )

  a		:      List[Any]       =  float(_A       )
  a		:      Optional[int]       =  theta // (2 * pi)
  theta -= 2 * div * pi
  return sum(
      (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1       ) for r in range(_A       )       )
def    lowerCamelCase__ (		_A				,    _A = 30       ):

  if not isinstance(_A				,    (int, float)       ):
    raise ValueError('maclaurin_cos() requires either an int or float for theta'       )

  if not isinstance(_A				,    _A       ) or accuracy <= 0:
    raise ValueError('maclaurin_cos() requires a positive int for accuracy'       )

  a		:      List[str]       =  float(_A       )
  a		:      List[str]       =  theta // (2 * pi)
  theta -= 2 * div * pi
  return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r       ) for r in range(_A       )       )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     print(maclaurin_sin(1_0))
     print(maclaurin_sin(-1_0))
     print(maclaurin_sin(1_0, 1_5))
     print(maclaurin_sin(-1_0, 1_5))

     print(maclaurin_cos(5))
     print(maclaurin_cos(-5))
     print(maclaurin_cos(1_0, 1_5))
     print(maclaurin_cos(-1_0, 1_5))