Skip to content

Commit

Permalink
🔥 remove comments and code duplications
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry committed Jul 12, 2024
1 parent c26b2dd commit 05c1735
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/move/tasks/analyze_latent.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,11 @@ def analyze_latent(config: MOVEConfig) -> None:

for i, dataset_name in enumerate(config.data.continuous_names):
logger.debug(f"Generating plot: feature importance '{dataset_name}'")
# NOT SURE IF IT WORKS THE SAME FOR CONTINUOUS FEATURES, CHECK THIS
# I did sth that did not work, I'll try again now.
con_dataset_names = config.data.continuous_names
target_idx = con_dataset_names.index(dataset_name)
# num_features = target_shape[0]

num_features = test_dataset.con_shapes[target_idx]

# num_features = len(dataloaders)

# We will use this inside the loop that iterates over all features:
# We create one diff per dataset, to not store all of them in memory
z = model.project(test_dataloader)
Expand Down
10 changes: 2 additions & 8 deletions src/move/tasks/encode_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ def encode_data(config: DataConfig):
)
fig.savefig(fig_path)

values, mask_1d = preprocessing.scale(values)
names = names[mask_1d]
logger.debug(f"Columns with zero variance: {np.sum(~mask_1d)}")
io.dump_names(interim_data_path / f"{dataset_name}.txt", names)
np.save(interim_data_path / f"{dataset_name}.npy", values)

# Plotting the value distribution for all continuous datasets:
fig = plot_value_distributions(values)
fig_path = str(output_path / f"Value_distribution_{dataset_name}.png")
Expand All @@ -74,5 +68,5 @@ def encode_data(config: DataConfig):
values, mask_1d = preprocessing.scale(values, input_config.log2)
names = names[mask_1d]
logger.debug(f"Columns with zero variance: {np.sum(~mask_1d)}")
io.dump_names(interim_data_path / f"{input_config.name}.txt", names)
np.save(interim_data_path / f"{input_config.name}.npy", values)
io.dump_names(interim_data_path / f"{dataset_name}.txt", names)
np.save(interim_data_path / f"{dataset_name}.npy", values)

0 comments on commit 05c1735

Please sign in to comment.