-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from pymc-labs/quickstart-fixes-and-general-im…
…provement Quickstart fixes and general improvement
- Loading branch information
Showing
17 changed files
with
302 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import causalpy.pymc_experiments | ||
import causalpy.pymc_models | ||
import causalpy.skl_experiments | ||
import causalpy.skl_models | ||
|
||
from .data import load_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""Code for loading datasets.""" | ||
from .datasets import load_data | ||
|
||
__all__ = ["load_data"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
import pathlib | ||
|
||
import pandas as pd | ||
|
||
import causalpy as cp | ||
|
||
DATASETS = { | ||
"banks": {"filename": "banks.csv"}, | ||
"did": {"filename": "did.csv"}, | ||
"drinking": {"filename": "drinking.csv"}, | ||
"its": {"filename": "its.csv"}, | ||
"its simple": {"filename": "its_simple.csv"}, | ||
"rd": {"filename": "regression_discontinuity.csv"}, | ||
"sc": {"filename": "synthetic_control.csv"}, | ||
} | ||
|
||
|
||
def get_data_home(): | ||
"""Return the path of the data directory""" | ||
return pathlib.Path(cp.__file__).parents[1] / "causalpy" / "data" | ||
|
||
|
||
def load_data(dataset: str = None): | ||
|
||
if dataset in DATASETS: | ||
|
||
data_dir = get_data_home() | ||
datafile = DATASETS[dataset] | ||
file_path = data_dir / datafile["filename"] | ||
return pd.read_csv(file_path) | ||
else: | ||
raise ValueError(f"Dataset {dataset} not found!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.0.2" | ||
__version__ = "0.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
arviz>=0.13.0rc1 | ||
arviz>=0.14.0 | ||
graphviz | ||
matplotlib>=3.5.3 | ||
numpy | ||
|