






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





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase    ,      UpperCamelCase    ,      UpperCamelCase				)				->	np.ndarray:
							lowerCamelCase__ :     List[str]	  =	XGBRegressor(verbosity=0    ,      random_state=42				)
							xgb.fit(UpperCamelCase    ,      UpperCamelCase				)
							# Predict target for test data
							lowerCamelCase__ :     Union[str, Any]	  =	xgb.predict(UpperCamelCase				)
							lowerCamelCase__ :     List[str]	  =	predictions.reshape(len(UpperCamelCase				)    ,      1				)
							return predictions





def 			SCREAMING_SNAKE_CASE_	()				->	None:
							lowerCamelCase__ :     Tuple	  =	fetch_california_housing()
							lowerCamelCase__  ,		lowerCamelCase__ :     List[Any]	  =	data_handling(UpperCamelCase				)
							lowerCamelCase__  ,		lowerCamelCase__  ,		lowerCamelCase__  ,		lowerCamelCase__ :     str	  =	train_test_split(
							    UpperCamelCase    ,      UpperCamelCase    ,      test_size=0.25    ,      random_state=1				)
							lowerCamelCase__ :     Any	  =	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 torch import nn





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase				)				->	Dict:
							if act_fn in ["swish", "silu"]:
														return nn.SiLU()
							elif act_fn == "mish":
														return nn.Mish()
							elif act_fn == "gelu":
														return nn.GELU()
							else:
														raise ValueError(f'''Unsupported activation function: {act_fn}'''				)

