






'''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    lowercase__			(				__UpperCamelCase   )->			tuple:
      return (data["data"], data["target"])







def    lowercase__			(				__UpperCamelCase		,						__UpperCamelCase		,						__UpperCamelCase   )->			np.ndarray:
      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:
      UpperCamelCase      = fetch_california_housing()
      UpperCamelCase  ,UpperCamelCase      = data_handling(__UpperCamelCase   )
      UpperCamelCase  ,UpperCamelCase  ,UpperCamelCase  ,UpperCamelCase      = train_test_split(
          __UpperCamelCase		,						__UpperCamelCase		,						test_size=0.25		,						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()








'''simple docstring'''

from maths.is_square_free import is_square_free
from maths.prime_factors import prime_factors







def    lowercase__			(				__UpperCamelCase   )->			int:
      UpperCamelCase      = prime_factors(__UpperCamelCase   )
      if is_square_free(__UpperCamelCase   ):
            return -1 if len(__UpperCamelCase   ) % 2 else 1
      return 0


if __name__ == "__main__":
     import doctest

     doctest.testmod()
