9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf,ml/rl/preprocessing/sparse_to_dense.py,PythonSparseToDenseProcessor,process,#PythonSparseToDenseProcessor#Any#,73
Before Change
dense_presence = torch.zeros(
[len(sparse_data), len(self.feature_id_to_index)]
).byte()
for i, feature_map in enumerate(sparse_data):
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:
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
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: astorfi/TensorFlow-World
Commit Name: 496e3d795c1f33010899f34c2e171a76a3d8e75c
Time: 2017-06-14
Author: amirsina.torfi@gmail.com
File Name: codes/2-basics_in_machine_learning/linear_svm/code/linear_SVM.py
Class Name:
Method Name:
Project Name: keras-team/keras
Commit Name: b938b91b527760cef3af29031e74ab181f2fc2b9
Time: 2019-07-07
Author: psv@google.com
File Name: keras/engine/training_generator.py
Class Name:
Method Name: evaluate_generator
Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: bc388862e12e27c1494078aa2409f1875ebba693
Time: 2020-06-06
Author: eldraco@gmail.com
File Name: modules/lstm-cc-detection-1/lstm-cc-detection-1.py
Class Name: Module
Method Name: convert_input_for_module