9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf,ml/rl/preprocessing/sparse_to_dense.py,PythonSparseToDenseProcessor,process,#PythonSparseToDenseProcessor#Any#,73

Before Change


            assert (
                feature_map is not None
            ), f"Please make sure that features are not NULL; row {i}"
            for j, value in feature_map.items():
                j_index = self.feature_id_to_index.get(j, None)
                if j_index is None:
                    continue
                dense_data[i][j_index] = value
                dense_presence[i][j_index] = 1
        if self.set_missing_value_to_zero:
            // When we set missing values to 0, we don"t know what is and isn"t missing
            dense_presence = dense_data != 0.0
        return (dense_data, dense_presence)

After Change


        for col in self.sorted_features:
            if col not in state_features_df.columns:
                state_features_df[col] = missing_value
        values = torch.from_numpy(
            state_features_df[self.sorted_features].values
        ).float()
        if self.set_missing_value_to_zero:
            // When we set missing values to 0, we don"t know what is and isn"t missing
            presence = torch.ones_like(values, dtype=torch.bool)
        else:
            presence = values != missing_value
        return values, presence
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/Horizon
Commit Name: 9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf
Time: 2019-12-12
Author: kittipat@fb.com
File Name: ml/rl/preprocessing/sparse_to_dense.py
Class Name: PythonSparseToDenseProcessor
Method Name: process


Project Name: quadrismegistus/prosodic
Commit Name: 1d1f38f78657c3d2417bf47f8885f3973e52d7ba
Time: 2017-04-15
Author: ryan.heuser@gmail.com
File Name: lib/Parse.py
Class Name: Parse
Method Name: str_ot


Project Name: home-assistant/home-assistant
Commit Name: 9f54bcc21b1744f2850a35e54903f3581d14badb
Time: 2015-12-23
Author: marhje52@kth.se
File Name: homeassistant/components/sensor/mysensors.py
Class Name:
Method Name: setup_platform