




def      A      (      _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )	-> int:
       lowerCamelCase   :      Union[str, Any]			 =					1  # To kept the Calculated Value
       # Since C(n, k) = C(n, n-k)
       if k > (n - k):
              lowerCamelCase   :      Any			 =					n - k
       # Calculate C(n,k)
       for i in range(_SCREAMING_SNAKE_CASE    ):
              result *= n - i
              result //= i + 1
       return result

def      A      (      _SCREAMING_SNAKE_CASE    )	-> int:
       return binomial_coefficient(2 * node_count ,_SCREAMING_SNAKE_CASE    ) // (node_count + 1)

def      A      (      _SCREAMING_SNAKE_CASE    )	-> int:
       if n < 0:
              raise ValueError("factorial() not defined for negative values"    )
       lowerCamelCase   :      List[Any]			 =					1
       for i in range(1 ,n + 1    ):
              result *= i
       return result

def      A      (      _SCREAMING_SNAKE_CASE    )	-> int:
       return catalan_number(_SCREAMING_SNAKE_CASE    ) * factorial(_SCREAMING_SNAKE_CASE    )


if __name__ == "__main__":
       SCREAMING_SNAKE_CASE__       :      Any  =   int(input('Enter the number of nodes: ').strip() or 0)
       if node_count <= 0:
              raise ValueError('We need some nodes to work with.')
       print(
           f'''Given {node_count} nodes, there are {binary_tree_count(node_count)} '''
           f'''binary trees and {catalan_number(node_count)} binary search trees.'''
       )












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()






