


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



     """simple docstring"""






     return (data["data"], data["target"])
def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_							):



     """simple docstring"""






     snake_case											=							XGBRegressor(verbosity=0				,random_state=42							)
     xgb.fit(UpperCamelCase_				,UpperCamelCase_							)
     # Predict target for test data
     snake_case											=							xgb.predict(UpperCamelCase_							)
     snake_case											=							predictions.reshape(len(UpperCamelCase_							)				,1							)
     return predictions
def      UpperCAmelCase__		():



     """simple docstring"""






     snake_case											=							fetch_california_housing()
     snake_case					,    snake_case											=							data_handling(UpperCamelCase_							)
     snake_case					,    snake_case					,    snake_case					,    snake_case											=							train_test_split(
         UpperCamelCase_				,UpperCamelCase_				,test_size=0.25				,random_state=1							)
     snake_case											=							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      UpperCAmelCase__		(UpperCamelCase_ = 10_00							):



     """simple docstring"""






     return sum(2 * a * ((a - 1) // 2) for a in range(3				,n + 1							)							)


if __name__ == "__main__":
 print(solution())




