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 			lowercase(	UpperCamelCase_       )		->	tuple:







 '''simple docstring'''
 return (data["data"], data["target"])





def 			lowercase(	UpperCamelCase_							,					UpperCamelCase_							,					UpperCamelCase_       )		->	np.ndarray:







 '''simple docstring'''
 UpperCamelCase			  =      XGBRegressor(verbosity=0							,					random_state=42       )
 xgb.fit(UpperCamelCase_							,					UpperCamelCase_       )
 # Predict target for test data
 UpperCamelCase			  =      xgb.predict(UpperCamelCase_       )
 UpperCamelCase			  =      predictions.reshape(len(UpperCamelCase_       )							,					1       )
 return predictions





def 			lowercase(	)		->	None:







 '''simple docstring'''
 UpperCamelCase			  =      fetch_california_housing()
 UpperCamelCase  ,     UpperCamelCase			  =      data_handling(UpperCamelCase_       )
 UpperCamelCase  ,     UpperCamelCase  ,     UpperCamelCase  ,     UpperCamelCase			  =      train_test_split(
     UpperCamelCase_							,					UpperCamelCase_							,					test_size=0.2_5							,					random_state=1       )
 UpperCamelCase			  =      xgboost(UpperCamelCase_							,					UpperCamelCase_							,					UpperCamelCase_       )
 # Error printing
 print(f"""Mean Absolute Error : {mean_absolute_error(UpperCamelCase_							,					UpperCamelCase_       )}"""       )
 print(f"""Mean Square Error  : {mean_squared_error(UpperCamelCase_							,					UpperCamelCase_       )}"""       )


if __name__ == "__main__":
     import doctest

     doctest.testmod(verbose=True)
     main()

def 			lowercase(	UpperCamelCase_ = 100       )		->	int:







 '''simple docstring'''
 UpperCamelCase			  =      n * (n + 1) * (2 * n + 1) / 6
 UpperCamelCase			  =      (n * (n + 1) / 2) ** 2
 return int(square_of_sum - sum_of_squares       )


if __name__ == "__main__":
     print(F'''{solution() = }''')
