



"""simple docstring"""
import math
from collections.abc import Callable


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase ,  __lowerCAmelCase							) ->						Optional[Any]:







		'''simple docstring'''


		lowercase_								= xa
		lowercase_								= xa
		while True:
				if x_n == x_na or function(snake_case__							) == function(snake_case__							):
						raise ZeroDivisionError("""float division by zero, could not find root"""							)
				lowercase_								= x_na - (
				    function(snake_case__							) / ((function(snake_case__							) - function(snake_case__							)) / (x_na - x_n))
				)
				if abs(x_na - x_na							) < 10**-5:
						return x_na
				lowercase_								= x_na
				lowercase_								= x_na


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						Union[str, Any]:







		'''simple docstring'''


		return math.pow(snake_case__ ,  3							) - (2 * x) - 5


if __name__ == "__main__":
							print(intersection(f, 3, 3.5))






"""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 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						tuple:







  '''simple docstring'''


  return (data["data"], data["target"])


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase ,  __lowerCAmelCase							) ->						np.ndarray:







  '''simple docstring'''


  lowercase_								= XGBRegressor(verbosity=0 ,  random_state=42							)
  xgb.fit(__lowerCAmelCase ,  __lowerCAmelCase							)
  # Predict target for test data
  lowercase_								= xgb.predict(__lowerCAmelCase							)
  lowercase_								= predictions.reshape(len(__lowerCAmelCase							) ,  1							)
  return predictions


def 			_SCREAMING_SNAKE_CASE						() ->						None:







  '''simple docstring'''


  lowercase_								= fetch_california_housing()
  lowercase_					,    lowercase_								= data_handling(__lowerCAmelCase							)
  lowercase_					,    lowercase_					,    lowercase_					,    lowercase_								= train_test_split(
      __lowerCAmelCase ,  __lowerCAmelCase ,  test_size=0.25 ,  random_state=1							)
  lowercase_								= xgboost(__lowerCAmelCase ,  __lowerCAmelCase ,  __lowerCAmelCase							)
  # Error printing
  print(F'''Mean Absolute Error : {mean_absolute_error(__lowerCAmelCase ,  __lowerCAmelCase							)}'''							)
  print(F'''Mean Square Error  : {mean_squared_error(__lowerCAmelCase ,  __lowerCAmelCase							)}'''							)


if __name__ == "__main__":
       import doctest

       doctest.testmod(verbose=True)
       main()

