




"""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     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return (data["data"], data["target"])






def     __UpperCAmelCase					(			lowercase   ,lowercase   ,lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      XGBRegressor(verbosity=0   ,random_state=42		)
  xgb.fit(lowercase   ,lowercase		)
  # Predict target for test data
  _UpperCAmelCase						 =      xgb.predict(lowercase		)
  _UpperCAmelCase						 =      predictions.reshape(len(lowercase		)   ,1		)
  return predictions






def     __UpperCAmelCase					(			):







  """simple docstring"""
  _UpperCAmelCase						 =      fetch_california_housing()
  _UpperCAmelCase ,				_UpperCAmelCase						 =      data_handling(lowercase		)
  _UpperCAmelCase ,				_UpperCAmelCase ,				_UpperCAmelCase ,				_UpperCAmelCase						 =      train_test_split(
      lowercase   ,lowercase   ,test_size=0.25   ,random_state=1		)
  _UpperCAmelCase						 =      xgboost(lowercase   ,lowercase   ,lowercase		)
  # Error printing
  print(f'''Mean Absolute Error : {mean_absolute_error(lowercase   ,lowercase		)}'''		)
  print(f'''Mean Square Error  : {mean_squared_error(lowercase   ,lowercase		)}'''		)


if __name__ == "__main__":
    import doctest

    doctest.testmod(verbose=True)
    main()

"""simple docstring"""


from __future__ import annotations






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return [ord(lowercase		) - 96 for elem in plain]






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return "".join(chr(elem + 96		) for elem in encoded		)






def     __UpperCAmelCase					(			):







  """simple docstring"""
  _UpperCAmelCase						 =      encode(input("""-> """		).strip().lower()		)
  print("""Encoded: """   ,lowercase		)
  print("""Decoded:"""   ,decode(lowercase		)		)


if __name__ == "__main__":
    main()
