

"""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						(					__UpperCamelCase      ):
 '''simple docstring'''





 return (data["data"], data["target"])
def   lowerCAmelCase						(					__UpperCamelCase							,    __UpperCamelCase							,    __UpperCamelCase      ):
 '''simple docstring'''





 UpperCAmelCase__					:  int					   =					XGBRegressor(verbosity=0							,    random_state=42      )
 xgb.fit(__UpperCamelCase							,    __UpperCamelCase      )
 # Predict target for test data
 UpperCAmelCase__					:  Optional[Any]					   =					xgb.predict(__UpperCamelCase      )
 UpperCAmelCase__					:  Optional[int]					   =					predictions.reshape(len(__UpperCamelCase      )							,    1      )
 return predictions
def   lowerCAmelCase						(					):
 '''simple docstring'''





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








"""simple docstring"""




def   lowerCAmelCase						(					__UpperCamelCase = 1000      ):
 '''simple docstring'''





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


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





