Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 327445277
  • Loading branch information
Google Research Team authored and copybara-github committed Aug 19, 2020
1 parent 692bb24 commit 898f347
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions correct_batch_effects_wdn/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ def matrix(dist_fn, df, aux_df=None, n_jobs=1, **kwds):
if aux_df is not None:
combined = np.zeros([dfrow, dfcol + int(auxrow / dfrow) * auxcol])
for i, (idx, row) in enumerate(df.iterrows()):
combined[i, :] = _combine(row.as_matrix(), aux_df.loc[idx].as_matrix())
combined[i, :] = _combine(row.values, aux_df.loc[idx].values)
kwds.update(dist_fn=dist_fn, dfcol=dfcol, auxcol=auxcol)
dist = sklearn.metrics.pairwise.pairwise_distances(
X=combined, metric=_wrapped_dist_fn, n_jobs=n_jobs, **kwds)
else:
dist = sklearn.metrics.pairwise.pairwise_distances(
X=df.as_matrix(), metric=dist_fn, n_jobs=n_jobs, **kwds)
X=df.values, metric=dist_fn, n_jobs=n_jobs, **kwds)

return pd.DataFrame(dist, columns=df.index, index=df.index)

0 comments on commit 898f347

Please sign in to comment.