Skip to content

Commit

Permalink
output m u
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinL committed Apr 6, 2020
1 parent b8248d7 commit 5ebce25
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions splink/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,24 @@ def is_converged(self):

### The rest of this module is just 'presentational' elements - charts, and __repr__ etc.

def _print_m_u_probs(self):

def field_value_to_probs(fv):
m_probs = []
for key, val in fv['prob_dist_match'].items():
m_probs.append(val["probability"])
u_probs = []
for key, val in fv['prob_dist_non_match'].items():
u_probs.append(val["probability"])

print(f'"m_probabilities": {m_probs},')
print(f'"u_probabilities": {u_probs}')

for field, value in self.params['π'].items():
print(field)
field_value_to_probs(value)


def pi_iteration_chart(self): # pragma: no cover

if self.real_params:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,3 +635,5 @@ def test_main_api(spark, sqlite_con_1):
row_dict = df_e.toPandas().sample(1).to_dict(orient="records")[0]
print(intuition_report(row_dict, params))

linker.params._print_m_u_probs()

0 comments on commit 5ebce25

Please sign in to comment.