'''simple docstring'''




from __future__ import annotations






def __lowerCAmelCase (							UpperCamelCase__				,  UpperCamelCase__				)	->    list[str]:
    if nth_term == "":
        return [""]
    __lowerCamelCase		=  int(UpperCamelCase__				)
    __lowerCamelCase		=  int(UpperCamelCase__				)
    __lowerCamelCase		=  []
    for temp in range(int(UpperCamelCase__				)				):
        series.append(f"""1 / {pow(temp + 1				,  int(UpperCamelCase__				)				)}""" if series else '''1'''				)
    return series


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  __UpperCAmelCase     							=int(input("Enter the last number (nth term) of the P-Series"))
  __UpperCAmelCase     							=int(input("Enter the power for  P-Series"))
  print("Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p")
  print(p_series(nth_term, power))






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

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

def      A      (      )	-> None:
       lowerCamelCase   :      Dict			 =					fetch_california_housing()
       lowerCamelCase ,      lowerCamelCase   :      Tuple			 =					data_handling(_SCREAMING_SNAKE_CASE    )
       lowerCamelCase ,      lowerCamelCase ,      lowerCamelCase ,      lowerCamelCase   :      Optional[Any]			 =					train_test_split(
           _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE ,test_size=0.25 ,random_state=1    )
       lowerCamelCase   :      Any			 =					xgboost(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )
       # Error printing
       print(f'''Mean Absolute Error : {mean_absolute_error(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )}'''    )
       print(f'''Mean Square Error  : {mean_squared_error(_SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )}'''    )


if __name__ == "__main__":
       import doctest

       doctest.testmod(verbose=True)
       main()






