



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__			(		_UpperCamelCase			: Optional[Any]							):
			return (data["data"], data["target"])





def 		a__			(		_UpperCamelCase			: Union[str, Any] ,_UpperCamelCase			: Tuple ,_UpperCamelCase			: List[str]							):
			__lowerCamelCase													=    XGBRegressor(verbosity=0 ,random_state=42							)
			xgb.fit(_UpperCamelCase ,_UpperCamelCase							)
			# Predict target for test data
			__lowerCamelCase													=    xgb.predict(_UpperCamelCase							)
			__lowerCamelCase													=    predictions.reshape(len(_UpperCamelCase							) ,1							)
			return predictions





def 		a__			(		):
			__lowerCamelCase													=    fetch_california_housing()
			__lowerCamelCase							,__lowerCamelCase													=    data_handling(_UpperCamelCase							)
			__lowerCamelCase							,__lowerCamelCase							,__lowerCamelCase							,__lowerCamelCase													=    train_test_split(
			    _UpperCamelCase ,_UpperCamelCase ,test_size=0.25 ,random_state=1							)
			__lowerCamelCase													=    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()











from collections import namedtuple

import requests
from lxml import html  # type: ignore

a_			=					namedtuple("""covid_data""", """cases deaths recovered""")





def 		a__			(		_UpperCamelCase			: str = "https://www.worldometers.info/coronavirus/"							):
   __lowerCamelCase													=    '''//div[@class = "maincounter-number"]/span/text()'''
   return covid_data(*html.fromstring(requests.get(_UpperCamelCase							).content							).xpath(_UpperCamelCase							)							)


a_			=					"""Total COVID-19 cases in the world: {}
Total deaths due to COVID-19 in the world: {}
Total COVID-19 patients recovered in the world: {}"""





print(fmt.format(*covid_stats()))






