CAnDOIT
This module provides the CausalDiscoveryMethod class.
Classes
CausalDiscoveryMethod: abstract class used by all the causal discovery algorithms.
CausalDiscoveryMethod
Bases: ABC
CausalDiscoveryMethod class.
CausalDiscoveryMethod is an abstract causal discovery method for large-scale time series datasets.
Source code in causalflow/causal_discovery/CausalDiscoveryMethod.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
__init__(data, min_lag, max_lag, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class contructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/CausalDiscoveryMethod.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
load(res_path)
Load previously estimated result .
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_path |
str
|
pickle file path. |
required |
Source code in causalflow/causal_discovery/CausalDiscoveryMethod.py
78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
run()
abstractmethod
Run causal discovery method.
Returns:
Name | Type | Description |
---|---|---|
DAG |
DAG
|
causal model. |
Source code in causalflow/causal_discovery/CausalDiscoveryMethod.py
67 68 69 70 71 72 73 74 75 |
|
save()
Save causal discovery result as pickle file if resfolder is set.
Source code in causalflow/causal_discovery/CausalDiscoveryMethod.py
93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
This module provides the FPCMCI class.
Classes
FPCMCI: class containing the FPCMCI causal discovery algorithm.
FPCMCI
Bases: CausalDiscoveryMethod
F-PCMCI causal discovery method.
Source code in causalflow/causal_discovery/FPCMCI.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
__init__(data, min_lag, max_lag, sel_method, val_condtest, verbosity, f_alpha=0.05, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class contructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
sel_method |
SelectionMethod
|
selection method. |
required |
val_condtest |
CondIndTest
|
validation method. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
f_alpha |
float
|
filter significance level. Defaults to 0.05. |
0.05
|
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/FPCMCI.py
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 51 52 53 54 |
|
load(res_path)
Load previously estimated result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_path |
str
|
pickle file path. |
required |
Source code in causalflow/causal_discovery/FPCMCI.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
run(remove_unneeded=True, nofilter=False)
Run F-PCMCI.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
remove_unneeded |
bool
|
Bit to remove unneeded (isolated) variables. Defaults to True. |
True
|
nofilter |
bool
|
Bit to run F-PCMCI without filter. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
DAG |
DAG
|
causal model. |
Source code in causalflow/causal_discovery/FPCMCI.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
run_filter()
Run filter method.
Source code in causalflow/causal_discovery/FPCMCI.py
57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
save()
Save causal discovery result as pickle file if resfolder is set.
Source code in causalflow/causal_discovery/FPCMCI.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
This module provides the CAnDOIT class.
Classes
CAnDOIT: class containing the CAnDOIT causal discovery algorithm.
CAnDOIT
Bases: CausalDiscoveryMethod
CAnDOIT causal discovery method.
Source code in causalflow/causal_discovery/CAnDOIT.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
isThereInterv: bool
property
Check whether an intervention is present or not.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
flag to identify if an intervention is present or not. |
JCI_assumptions()
Initialise the algorithm initial causal structure with the JCI assumptions.
Source code in causalflow/causal_discovery/CAnDOIT.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
__init__(observation_data, intervention_data, max_lag, sel_method, val_condtest, verbosity, f_alpha=0.05, alpha=0.05, resfolder=None, neglect_only_autodep=False, exclude_context=True, plot_data=False, clean_cls=True)
Class contructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
observation_data |
Data
|
observational data to analyse. |
required |
intervention_data |
dict
|
interventional data to analyse in the form {INTERVENTION_VARIABLE : Data (same variables of observation_data)}. |
required |
max_lag |
int
|
maximum time lag. |
required |
sel_method |
SelectionMethod
|
selection method. |
required |
val_condtest |
CondIndTest
|
validation method. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
f_alpha |
float
|
filter significance level. Defaults to 0.05. |
0.05
|
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
exclude_context |
bool
|
Bit for neglecting context variables. Defaults to False. |
True
|
plot_data |
bool
|
Bit for plotting your data. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/CAnDOIT.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
load(res_path)
Load previously estimated result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_path |
str
|
pickle file path. |
required |
Source code in causalflow/causal_discovery/CAnDOIT.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
run(remove_unneeded=True, nofilter=True)
Run CAnDOIT.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
remove_unneeded |
bool
|
Bit to remove unneeded (isolated) variables. Defaults to True. |
True
|
nofilter |
bool
|
Bit to run CAnDOIT without filter. Defaults to False. |
True
|
Returns:
Name | Type | Description |
---|---|---|
DAG |
DAG
|
causal model. |
Source code in causalflow/causal_discovery/CAnDOIT.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
run_filter()
Run filter method.
Source code in causalflow/causal_discovery/CAnDOIT.py
159 160 161 162 163 164 |
|
run_validator(link_assumptions=None)
Run Validator (LPCMCI).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_assumptions |
dict
|
link assumption with context. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
DAG |
DAG
|
causal model with context. |
Source code in causalflow/causal_discovery/CAnDOIT.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
save()
Save causal discovery result as pickle file if resfolder is set.
Source code in causalflow/causal_discovery/CAnDOIT.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
|
This module provides the DYNOTEARS class.
Classes
DYNOTEARS: class containing the DYNOTEARS causal discovery algorithm.
DYNOTEARS
Bases: CausalDiscoveryMethod
DYNOTEARS causal discovery method.
Source code in causalflow/causal_discovery/baseline/DYNOTEARS.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
__init__(data, min_lag, max_lag, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/DYNOTEARS.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
run()
Run DYNOTEARS algorithm.
Returns:
Name | Type | Description |
---|---|---|
DAG |
DAG
|
causal discovery result. |
Source code in causalflow/causal_discovery/baseline/DYNOTEARS.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
This module provides the LPCMCI class.
Classes
LPCMCI: class containing the LPCMCI causal discovery algorithm.
LPCMCI
Bases: CausalDiscoveryMethod
LPCMCI causal discovery method.
Source code in causalflow/causal_discovery/baseline/LPCMCI.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
__init__(data, min_lag, max_lag, val_condtest, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
val_condtest |
CondIndTest
|
validation method. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/LPCMCI.py
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 51 52 53 |
|
run(link_assumptions=None)
Run causal discovery algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_assumptions |
dict
|
prior knowledge on causal model links. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/LPCMCI.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
This module provides the PCMCI class.
Classes
PCMCI: class containing the PCMCI causal discovery algorithm.
PCMCI
Bases: CausalDiscoveryMethod
PCMCI causal discovery method.
Source code in causalflow/causal_discovery/baseline/PCMCI.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
__init__(data, min_lag, max_lag, val_condtest, verbosity, pc_alpha=0.05, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
val_condtest |
CondIndTest
|
validation method. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
pc_alpha |
float
|
PC significance level. Defaults to 0.05. |
0.05
|
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/PCMCI.py
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 51 52 53 54 55 56 57 |
|
run(link_assumptions=None)
Run causal discovery algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_assumptions |
dict
|
prior knowledge on causal model links. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/PCMCI.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
This module provides the PCMCI+ class.
Classes
PCMCIplus: class containing the PCMCI+ causal discovery algorithm.
PCMCIplus
Bases: CausalDiscoveryMethod
PCMCI+ causal discovery method.
Source code in causalflow/causal_discovery/baseline/PCMCIplus.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
__init__(data, min_lag, max_lag, val_condtest, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
val_condtest |
CondIndTest
|
validation method. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/PCMCIplus.py
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 51 52 53 |
|
run(link_assumptions=None)
Run causal discovery algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_assumptions |
dict
|
prior knowledge on causal model links. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/PCMCIplus.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
This module provides the TCDF class.
Classes
TCDF: class containing the TCDF causal discovery algorithm.
TCDF
Bases: CausalDiscoveryMethod
TCDF causal discovery method.
Source code in causalflow/causal_discovery/baseline/TCDF.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
__init__(data, min_lag, max_lag, verbosity, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/TCDF.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
run(epochs=1000, kernel_size=4, dilation_coefficient=4, hidden_layers=0, learning_rate=0.01, cuda=False)
Run causal discovery algorithm.
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/TCDF.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
This module provides the tsFCI class.
Classes
tsFCI: class containing the tsFCI causal discovery algorithm.
tsFCI
Bases: CausalDiscoveryMethod
tsFCI causal discovery method.
Source code in causalflow/causal_discovery/baseline/tsFCI.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
__init__(data, min_lag, max_lag, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/tsFCI.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
run()
Run causal discovery algorithm.
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/tsFCI.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
ts_fci_dataframe_to_dict(df, names, nlags)
Convert tsFCI result into a dict for _to_DAG.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
graph. |
required |
names |
list[str]
|
variables' name. |
required |
nlags |
int
|
max time lag. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
dict graph. |
Source code in causalflow/causal_discovery/baseline/tsFCI.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
This module provides the VarLiNGAM class.
Classes
VarLiNGAM: class containing the VarLiNGAM causal discovery algorithm.
VarLiNGAM
Bases: CausalDiscoveryMethod
VarLiNGAM causal discovery method.
Source code in causalflow/causal_discovery/baseline/VarLiNGAM.py
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
__init__(data, min_lag, max_lag, verbosity, alpha=0.05, resfolder=None, neglect_only_autodep=False, clean_cls=True)
Class constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Data
|
data to analyse. |
required |
min_lag |
int
|
minimum time lag. |
required |
max_lag |
int
|
maximum time lag. |
required |
verbosity |
CPLevel
|
verbosity level. |
required |
alpha |
float
|
PCMCI significance level. Defaults to 0.05. |
0.05
|
resfolder |
string
|
result folder to create. Defaults to None. |
None
|
neglect_only_autodep |
bool
|
Bit for neglecting variables with only autodependency. Defaults to False. |
False
|
clean_cls |
bool
|
Clean console bit. Default to True. |
True
|
Source code in causalflow/causal_discovery/baseline/VarLiNGAM.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
run()
Run causal discovery algorithm.
Returns:
Type | Description |
---|---|
DAG
|
estimated causal model. |
Source code in causalflow/causal_discovery/baseline/VarLiNGAM.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|