-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexplain_fastai_composed.html
50 lines (47 loc) · 4.64 KB
/
explain_fastai_composed.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module explain_fastai_composed</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>explain_fastai_composed</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/data/s6jetraj/Development/TEST/CBRF-FB13-/explain_fastai_composed.py">/data/s6jetraj/Development/TEST/CBRF-FB13-/explain_fastai_composed.py</a></font></td></tr></table>
<p><tt>@author: Jelena Trajkovic<br>
<br>
This file containsthe method for explanations generation by using CBRF model.<br>
It contains additional methods for feature selection, generationg the samples <br>
around the head embedding...</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="calculate_variance.html">calculate_variance</a><br>
<a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="prepare_centroids.html">prepare_centroids</a><br>
<a href="pandas.html">pandas</a><br>
</td><td width="25%" valign=top><a href="pickle.html">pickle</a><br>
<a href="random.html">random</a><br>
</td><td width="25%" valign=top><a href="random_forest_model.html">random_forest_model</a><br>
<a href="train_model.html">train_model</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-delete_multiple_element"><strong>delete_multiple_element</strong></a>(list_object, indices)</dt><dd><tt>helper function which helps to delete multiple indexes.</tt></dd></dl>
<dl><dt><a name="-find_relations"><strong>find_relations</strong></a>(sub, rel, dataset)</dt><dd><tt>returns the features for the given head (sub). Also, rel is used for <br>
generating composed relations. Fetures are chosen in a way which assures <br>
the harmony with the underlying ground truth dataset.</tt></dd></dl>
<dl><dt><a name="-find_true_tails"><strong>find_true_tails</strong></a>(head, features_names, dataset)</dt><dd><tt>returns true tails from the dataset for features_names (relations)</tt></dd></dl>
<dl><dt><a name="-generate_explanations"><strong>generate_explanations</strong></a>(head, features_names, relation, tail, head_samples, dataset, model, random_forest, all_entities_number, all_relations_number)</dt><dd><tt>generate explanations for the best hit(tail) for (head, relation) pair.</tt></dd></dl>
<dl><dt><a name="-generate_samples"><strong>generate_samples</strong></a>(head, rel, tail, dataset, model, random_forest, number_of_instances)</dt><dd><tt>returns samples generated around the embedding of the head.</tt></dd></dl>
<dl><dt><a name="-predict_head_samples_tails_pandas"><strong>predict_head_samples_tails_pandas</strong></a>(head, features_names, head_samples, dataset, relation, model, random_forest, all_entities_number, all_relations_number)</dt><dd><tt>this function takes the relation-tails pair. For each of the relation-tails pair, <br>
for all head samples and given relation, we calculate the most probable tail.</tt></dd></dl>
<dl><dt><a name="-restore_models"><strong>restore_models</strong></a>()</dt><dd><tt>returns restored TransE and CBRF models.</tt></dd></dl>
</td></tr></table>
</body></html>