Skip to content

Commit

Permalink
Finish updating to Python 3.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 248431677
  • Loading branch information
Gil Tabak authored and copybara-github committed May 15, 2019
1 parent 16ce8f0 commit 264a020
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions correct_batch_effects_wdn/evaluate_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python2, python3
"""Evaluate several metrics for Wasserstein transformation."""

from __future__ import absolute_import
Expand All @@ -23,10 +24,10 @@

from absl import app
from absl import flags

import numpy as np
import pandas as pd
from scipy.spatial import distance
from six.moves import range
import six.moves.cPickle as pickle
from sklearn import ensemble
from sklearn import metrics
Expand Down Expand Up @@ -380,7 +381,7 @@ def cross_val_train(emb_df_clean, contents, steps, list_of_comp_set, n_comp,
dist_at_time[time_step_max] = dist

# k-NN up to k=4
for k in xrange(1, 5):
for k in range(1, 5):
update_stats_new_compound(comp_set, dist, k,
evaluate.not_same_compound_filter,
correct_nsc, mismatch_nsc,
Expand Down Expand Up @@ -763,7 +764,7 @@ def main(argv):
save_dict = {}

## Get steps over training
steps = contents.keys()
steps = list(contents.keys())
steps.remove("params")
steps = np.sort(steps)

Expand All @@ -782,7 +783,7 @@ def main(argv):

## Set up data structure for leave-one-out cross validation
list_of_comp_set = []
for i in xrange(n_comp):
for i in range(n_comp):
comp_set = {}
comp_set["b"] = comp_list[i]
comp_set["a"] = list(set(comp_list).difference([comp_list[i]]))
Expand Down
1 change: 1 addition & 0 deletions correct_batch_effects_wdn/ljosa_embeddings_to_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python2, python3
"""Convert Ljosa embeddings to h5 dataframe."""

from __future__ import absolute_import
Expand Down

0 comments on commit 264a020

Please sign in to comment.