





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





def       _UpperCamelCase       (a__				:np.ndarray				,     a__				:np.ndarray				,     a__				:np.ndarray    ):
							UpperCamelCase__			       =     XGBRegressor(verbosity=0				,     random_state=42    )
							xgb.fit(lowerCAmelCase__				,     lowerCAmelCase__    )
							# Predict target for test data
							UpperCamelCase__			       =     xgb.predict(lowerCAmelCase__    )
							UpperCamelCase__			       =     predictions.reshape(len(lowerCAmelCase__    )				,     1    )
							return predictions





def       _UpperCamelCase       ():
							UpperCamelCase__			       =     fetch_california_housing()
							UpperCamelCase__			       =     data_handling(lowerCAmelCase__    )
							UpperCamelCase__			       =     train_test_split(
							    lowerCAmelCase__				,     lowerCAmelCase__				,     test_size=0.25				,     random_state=1    )
							UpperCamelCase__			       =     xgboost(lowerCAmelCase__				,     lowerCAmelCase__				,     lowerCAmelCase__    )
							# Error printing
							print(f"""Mean Absolute Error : {mean_absolute_error(lowerCAmelCase__				,     lowerCAmelCase__    )}"""    )
							print(f"""Mean Square Error  : {mean_squared_error(lowerCAmelCase__				,     lowerCAmelCase__    )}"""    )


if __name__ == "__main__":
					import doctest

					doctest.testmod(verbose=True)
					main()











from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCamelCase__     =	{
    "configuration_swiftformer": [
        "SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "SwiftFormerConfig",
        "SwiftFormerOnnxConfig",
    ]
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCamelCase__     =	[
					    "SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "SwiftFormerForImageClassification",
					    "SwiftFormerModel",
					    "SwiftFormerPreTrainedModel",
					]

if TYPE_CHECKING:
					from .configuration_swiftformer import (
					    SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    SwiftFormerConfig,
					    SwiftFormerOnnxConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_swiftformer import (
										    SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    SwiftFormerForImageClassification,
										    SwiftFormerModel,
										    SwiftFormerPreTrainedModel,
										)

else:
					import sys

					UpperCamelCase__     =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




