



"""simple docstring"""
def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						Optional[int]:







		'''simple docstring'''


		if not numbers:
				return 0

		if not isinstance(lowerCAmelCase__ ,  (list, tuple)							) or not all(
		    isinstance(lowerCAmelCase__ ,  lowerCAmelCase__							) for number in numbers							):
				raise ValueError("""numbers must be an iterable of integers"""							)

		lowercase_								= lowercase_								= lowercase_								= numbers[0]

		for i in range(1 ,  len(lowerCAmelCase__							)							):
				# update the maximum and minimum subarray products
				lowercase_								= numbers[i]
				if number < 0:
						lowercase_					,    lowercase_								= min_till_now, max_till_now
				lowercase_								= max(lowerCAmelCase__ ,  max_till_now * number							)
				lowercase_								= min(lowerCAmelCase__ ,  min_till_now * number							)

				# update the maximum product found till now
				lowercase_								= max(lowerCAmelCase__ ,  lowerCAmelCase__							)

		return max_prod






"""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()

