






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 		_a       ( a					:dict					)				->     tuple:
 return (data["data"], data["target"])
def 		_a       ( a					:np.ndarray      ,				a					:np.ndarray      ,				a					:np.ndarray					)				->     np.ndarray:
 a						    = XGBRegressor(verbosity=0      ,				random_state=42					)
 xgb.fit(a      ,				a					)
 # Predict target for test data
 a						    = xgb.predict(a					)
 a						    = predictions.reshape(len(a					)      ,				1					)
 return predictions
def 		_a       ( )				->     None:
 a						    = fetch_california_housing()
 a    ,	a						    = data_handling(a					)
 a    ,	a    ,	a    ,	a						    = train_test_split(
     a      ,				a      ,				test_size=0.25      ,				random_state=1					)
 a						    = xgboost(a      ,				a      ,				a					)
 # Error printing
 print(F"""Mean Absolute Error : {mean_absolute_error(a      ,				a					)}"""					)
 print(F"""Mean Square Error  : {mean_squared_error(a      ,				a					)}"""					)


if __name__ == "__main__":
     import doctest

     doctest.testmod(verbose=True)
     main()










from typing import Any

import numpy as np
def 		_a       ( a					:np.ndarray					)				->     bool:
 return np.array_equal(a      ,				matrix.conjugate().T					)
def 		_a       ( a					:np.ndarray      ,				a					:np.ndarray					)				->     Any:
 a						    = v.conjugate().T
 a						    = v_star.dot(a					)
 assert isinstance(a      ,				np.ndarray					)
 return (v_star_dot.dot(a					)) / (v_star.dot(a					))
def 		_a       ( )				->     None:
 a						    = np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]					)
 a						    = np.array([[1], [2], [3]]					)
 assert is_hermitian(a					), F"""{a} is not hermitian."""
 print(rayleigh_quotient(a      ,				a					)					)

 a						    = np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]					)
 assert is_hermitian(a					), F"""{a} is not hermitian."""
 assert rayleigh_quotient(a      ,				a					) == float(3					)


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     tests()


