


'''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__	(    lowerCamelCase					:      dict       ):
       return (data["data"], data["target"])






def 				lowerCAmelCase__	(    lowerCamelCase					:      np.ndarray  ,lowerCamelCase					:      np.ndarray  ,lowerCamelCase					:      np.ndarray       ):
       _A					:     Tuple     = XGBRegressor(verbosity=0  ,random_state=42       )
       xgb.fit(lowerCamelCase  ,lowerCamelCase       )
       # Predict target for test data
       _A					:     Union[str, Any]     = xgb.predict(lowerCamelCase       )
       _A					:     Optional[Any]     = predictions.reshape(len(lowerCamelCase       )  ,1       )
       return predictions






def 				lowerCAmelCase__	(    ):
       _A					:     Dict     = fetch_california_housing()
       _A  ,			_A					:     Optional[int]     = data_handling(lowerCamelCase       )
       _A  ,			_A  ,			_A  ,			_A					:     Tuple     = train_test_split(
           lowerCamelCase  ,lowerCamelCase  ,test_size=0.25  ,random_state=1       )
       _A					:     int     = 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()










'''simple docstring'''







def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):

       def count_of_possible_combinations(lowerCamelCase					:      int       ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              return sum(count_of_possible_combinations(target - item       ) for item in array       )

       return count_of_possible_combinations(lowerCamelCase       )






def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):

       def count_of_possible_combinations_with_dp_array(
           lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]       ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              if dp_array[target] != -1:
                     return dp_array[target]
              _A					:     Optional[Any]     = sum(
                  count_of_possible_combinations_with_dp_array(target - item  ,lowerCamelCase       )
                  for item in array       )
              _A					:     List[str]     = answer
              return answer

       _A					:     Optional[int]     = [-1] * (target + 1)
       return count_of_possible_combinations_with_dp_array(lowerCamelCase  ,lowerCamelCase       )






def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):
       _A					:     Dict     = [0] * (target + 1)
       _A					:     List[str]     = 1

       for i in range(1  ,target + 1       ):
              for j in range(lowerCamelCase       ):
                     if i - array[j] >= 0:
                            dp_array[i] += dp_array[i - array[j]]

       return dp_array[target]


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   A				:					Dict    						=			3
   A				:					Union[str, Any]    						=			5
   A				:					Union[str, Any]    						=			[1, 2, 5]
   print(combination_sum_iv(n, array, target))






