99from sklearn .pipeline import Pipeline
1010
1111from fl4health .clients .basic_client import BasicClient
12- from fl4health .feature_alignment .constants import FEATURE_INFO , FORMAT_SPECIFIED , INPUT_DIMENSION , OUTPUT_DIMENSION
12+ from fl4health .feature_alignment .constants import FEATURE_INFO , INPUT_DIMENSION , OUTPUT_DIMENSION , SOURCE_SPECIFIED
1313from fl4health .feature_alignment .tab_features_info_encoder import TabularFeaturesInfoEncoder
1414from fl4health .feature_alignment .tab_features_preprocessor import TabularFeaturesPreprocessor
1515from fl4health .utils .metrics import Metric
@@ -43,17 +43,17 @@ def setup_client(self, config: Config) -> None:
4343 Initialize the client by encoding the information of its tabular data
4444 and initializing the corresponding TabularFeaturesPreprocessor.
4545
46- config[FORMAT_SPECIFIED ] indicates whether the server has obtained
46+ config[SOURCE_SPECIFIED ] indicates whether the server has obtained
4747 the source of information to perform feature alignment.
4848 If it is True, it means the server has obtained such information
4949 (either a priori or by polling a client).
5050 So the client will encode that information and use it instead
5151 to perform feature preprocessing.
5252 """
53- format_specified = self .narrow_config_type (config , FORMAT_SPECIFIED , bool )
53+ source_specified = self .narrow_config_type (config , SOURCE_SPECIFIED , bool )
5454 self .df = self .get_data_frame (config )
5555
56- if format_specified :
56+ if source_specified :
5757 # Since the server has obtained its source of information,
5858 # the client will encode that instead.
5959 self .tabular_features_info_encoder = TabularFeaturesInfoEncoder .from_json (
@@ -74,7 +74,7 @@ def setup_client(self, config: Config) -> None:
7474 # that the first dimension is the number of rows.
7575 self .input_dimension = self .aligned_features .shape [1 ]
7676 self .output_dimension = self .tabular_features_info_encoder .get_target_dimension ()
77- log (INFO , f"input dimension: { self .input_dimension } , output_dimension : { self .output_dimension } " )
77+ log (INFO , f"input dimension: { self .input_dimension } , target dimension : { self .output_dimension } " )
7878
7979 super ().setup_client (config )
8080
@@ -111,8 +111,8 @@ def get_properties(self, config: Config) -> Dict[str, Scalar]:
111111 """
112112 if not self .initialized :
113113 self .setup_client (config )
114- format_specified = self .narrow_config_type (config , FORMAT_SPECIFIED , bool )
115- if not format_specified :
114+ source_specified = self .narrow_config_type (config , SOURCE_SPECIFIED , bool )
115+ if not source_specified :
116116 return {
117117 FEATURE_INFO : self .tabular_features_info_encoder .to_json (),
118118 }
0 commit comments