Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed Jul 20, 2021
2 parents 5caf197 + 7d0f501 commit 73dd197
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Most recent releases are shown at the top. Each release shows:
- **Changed**: Additional parameters, changes to inputs or outputs, etc
- **Fixed**: Bug fixes that don't change documented behaviour

## 0.27.1 (2021-07-20)

### New:
- N/A

### Changed
- Added `method` parameter to `tabular.causal_inference_model`.

### Fixed:
- N/A


## 0.27.0 (2021-07-20)

### New:
Expand Down
19 changes: 13 additions & 6 deletions docs/tabular/causalinference.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ <h1 class="title">Module <code>ktrain.tabular.causalinference</code></h1>
</summary>
<pre><code class="python">def causal_inference_model(
df,
metalearner_type=&#39;t-learner&#39;,
method=&#39;t-learner&#39;,
metalearner_type=None,
treatment_col=&#39;treatment&#39;,
outcome_col=&#39;outcome&#39;,
text_col=None,
Expand Down Expand Up @@ -58,7 +59,8 @@ <h1 class="title">Module <code>ktrain.tabular.causalinference</code></h1>

**Parameters:**
* **df** : pandas.DataFrame containing dataset
* **metalearner_type** : metalearner model to use. One of {&#39;t-learner&#39;, &#39;s-learner&#39;, &#39;x-learner&#39;, &#39;r-learner&#39;} (Default: &#39;t-learner&#39;)
* **method** : metalearner model to use. One of {&#39;t-learner&#39;, &#39;s-learner&#39;, &#39;x-learner&#39;, &#39;r-learner&#39;} (Default: &#39;t-learner&#39;)
* **metalearner_type** : Alias of **method** parameter for backwards compatibility. If not None, overrides method.
* **treatment_col** : treatment variable; column should contain binary values: 1 for treated, 0 for untreated.
* **outcome_col** : outcome variable; column should contain the categorical or numeric outcome values
* **text_col** : (optional) text column containing the strings (e.g., articles, reviews, emails).
Expand Down Expand Up @@ -86,6 +88,7 @@ <h1 class="title">Module <code>ktrain.tabular.causalinference</code></h1>
from causalnlp.causalinference import CausalInferenceModel
return CausalInferenceModel(
df,
method=method,
metalearner_type=metalearner_type,
treatment_col=treatment_col,
outcome_col=outcome_col,
Expand All @@ -110,7 +113,7 @@ <h1 class="title">Module <code>ktrain.tabular.causalinference</code></h1>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="ktrain.tabular.causalinference.causal_inference_model"><code class="name flex">
<span>def <span class="ident">causal_inference_model</span></span>(<span>df, metalearner_type='t-learner', treatment_col='treatment', outcome_col='outcome', text_col=None, ignore_cols=[], include_cols=[], treatment_effect_col='treatment_effect', learner=None, effect_learner=None, min_df=0.05, max_df=0.5, ngram_range=(1, 1), stop_words='english', verbose=1)</span>
<span>def <span class="ident">causal_inference_model</span></span>(<span>df, method='t-learner', metalearner_type=None, treatment_col='treatment', outcome_col='outcome', text_col=None, ignore_cols=[], include_cols=[], treatment_effect_col='treatment_effect', learner=None, effect_learner=None, min_df=0.05, max_df=0.5, ngram_range=(1, 1), stop_words='english', verbose=1)</span>
</code></dt>
<dd>
<div class="desc"><pre><code>Infers causality from the data contained in `df` using a metalearner.
Expand All @@ -127,7 +130,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>

**Parameters:**
* **df** : pandas.DataFrame containing dataset
* **metalearner_type** : metalearner model to use. One of {'t-learner', 's-learner', 'x-learner', 'r-learner'} (Default: 't-learner')
* **method** : metalearner model to use. One of {'t-learner', 's-learner', 'x-learner', 'r-learner'} (Default: 't-learner')
* **metalearner_type** : Alias of **method** parameter for backwards compatibility. If not None, overrides method.
* **treatment_col** : treatment variable; column should contain binary values: 1 for treated, 0 for untreated.
* **outcome_col** : outcome variable; column should contain the categorical or numeric outcome values
* **text_col** : (optional) text column containing the strings (e.g., articles, reviews, emails).
Expand All @@ -153,7 +157,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
</summary>
<pre><code class="python">def causal_inference_model(
df,
metalearner_type=&#39;t-learner&#39;,
method=&#39;t-learner&#39;,
metalearner_type=None,
treatment_col=&#39;treatment&#39;,
outcome_col=&#39;outcome&#39;,
text_col=None,
Expand Down Expand Up @@ -183,7 +188,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>

**Parameters:**
* **df** : pandas.DataFrame containing dataset
* **metalearner_type** : metalearner model to use. One of {&#39;t-learner&#39;, &#39;s-learner&#39;, &#39;x-learner&#39;, &#39;r-learner&#39;} (Default: &#39;t-learner&#39;)
* **method** : metalearner model to use. One of {&#39;t-learner&#39;, &#39;s-learner&#39;, &#39;x-learner&#39;, &#39;r-learner&#39;} (Default: &#39;t-learner&#39;)
* **metalearner_type** : Alias of **method** parameter for backwards compatibility. If not None, overrides method.
* **treatment_col** : treatment variable; column should contain binary values: 1 for treated, 0 for untreated.
* **outcome_col** : outcome variable; column should contain the categorical or numeric outcome values
* **text_col** : (optional) text column containing the strings (e.g., articles, reviews, emails).
Expand Down Expand Up @@ -211,6 +217,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
from causalnlp.causalinference import CausalInferenceModel
return CausalInferenceModel(
df,
method=method,
metalearner_type=metalearner_type,
treatment_col=treatment_col,
outcome_col=outcome_col,
Expand Down
2 changes: 1 addition & 1 deletion docs/version.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 class="title">Module <code>ktrain.version</code></h1>
<span>Expand source code</span>
</summary>
<pre><code class="python">__all__ = [&#39;__version__&#39;]
__version__ = &#39;0.27.0&#39;</code></pre>
__version__ = &#39;0.27.1&#39;</code></pre>
</details>
</section>
<section>
Expand Down
7 changes: 5 additions & 2 deletions ktrain/tabular/causalinference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def causal_inference_model(
df,
metalearner_type='t-learner',
method='t-learner',
metalearner_type=None,
treatment_col='treatment',
outcome_col='outcome',
text_col=None,
Expand Down Expand Up @@ -30,7 +31,8 @@ def causal_inference_model(
**Parameters:**
* **df** : pandas.DataFrame containing dataset
* **metalearner_type** : metalearner model to use. One of {'t-learner', 's-learner', 'x-learner', 'r-learner'} (Default: 't-learner')
* **method** : metalearner model to use. One of {'t-learner', 's-learner', 'x-learner', 'r-learner'} (Default: 't-learner')
* **metalearner_type** : Alias of **method** parameter for backwards compatibility. If not None, overrides method.
* **treatment_col** : treatment variable; column should contain binary values: 1 for treated, 0 for untreated.
* **outcome_col** : outcome variable; column should contain the categorical or numeric outcome values
* **text_col** : (optional) text column containing the strings (e.g., articles, reviews, emails).
Expand Down Expand Up @@ -58,6 +60,7 @@ def causal_inference_model(
from causalnlp.causalinference import CausalInferenceModel
return CausalInferenceModel(
df,
method=method,
metalearner_type=metalearner_type,
treatment_col=treatment_col,
outcome_col=outcome_col,
Expand Down
2 changes: 1 addition & 1 deletion ktrain/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__all__ = ['__version__']
__version__ = '0.27.0'
__version__ = '0.27.1'

0 comments on commit 73dd197

Please sign in to comment.