




'''simple docstring'''


from __future__ import annotations
def 						snake_case_       (UpperCamelCase			:    float					,		UpperCamelCase			:    float					,		UpperCamelCase			:    float ):





							'''simple docstring'''


							if days_between_payments <= 0:
														raise ValueError('''days_between_payments must be > 0''' )
							if daily_interest_rate < 0:
														raise ValueError('''daily_interest_rate must be >= 0''' )
							if principal <= 0:
														raise ValueError('''principal must be > 0''' )
							return principal * daily_interest_rate * days_between_payments
def 						snake_case_       (UpperCamelCase			:    float					,		UpperCamelCase			:    float					,		UpperCamelCase			:    float					,		):





							'''simple docstring'''


							if number_of_compounding_periods <= 0:
														raise ValueError('''number_of_compounding_periods must be > 0''' )
							if nominal_annual_interest_rate_percentage < 0:
														raise ValueError('''nominal_annual_interest_rate_percentage must be >= 0''' )
							if principal <= 0:
														raise ValueError('''principal must be > 0''' )

							return principal * (
							    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
							    - 1
							)
def 						snake_case_       (UpperCamelCase			:    float					,		UpperCamelCase			:    float					,		UpperCamelCase			:    float					,		):





							'''simple docstring'''


							if number_of_years <= 0:
														raise ValueError('''number_of_years must be > 0''' )
							if nominal_annual_percentage_rate < 0:
														raise ValueError('''nominal_annual_percentage_rate must be >= 0''' )
							if principal <= 0:
														raise ValueError('''principal must be > 0''' )

							return compound_interest(
							    UpperCamelCase					,		nominal_annual_percentage_rate / 365					,		number_of_years * 365 )


if __name__ == "__main__":
				import doctest

				doctest.testmod()







'''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 						snake_case_       (UpperCamelCase			:    dict ):





							'''simple docstring'''


							return (data["data"], data["target"])
def 						snake_case_       (UpperCamelCase			:    np.ndarray					,		UpperCamelCase			:    np.ndarray					,		UpperCamelCase			:    np.ndarray ):





							'''simple docstring'''


							_a      	=							XGBRegressor(verbosity=0					,		random_state=42 )
							xgb.fit(UpperCamelCase					,		UpperCamelCase )
							# Predict target for test data
							_a      	=							xgb.predict(UpperCamelCase )
							_a      	=							predictions.reshape(len(UpperCamelCase )					,		1 )
							return predictions
def 						snake_case_       ():





							'''simple docstring'''


							_a      	=							fetch_california_housing()
							_a	,				_a      	=							data_handling(UpperCamelCase )
							_a	,				_a	,				_a	,				_a      	=							train_test_split(
							    UpperCamelCase					,		UpperCamelCase					,		test_size=0.25					,		random_state=1 )
							_a      	=							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()

