Skip to content

Commit f7641ba

Browse files
committed
[DATALAD RUNCMD] run codespell throughout
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent 8878f03 commit f7641ba

File tree

19 files changed

+42
-42
lines changed

19 files changed

+42
-42
lines changed

causallearn/search/ConstraintBased/PC.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def detect_parent(r: int, data_: ndarray, alpha: float, indep_test, stable: bool
394394
def get_parent(r: int, cg_skel_adj: ndarray) -> ndarray:
395395
"""Get the neighbors of missingness indicators which are the parents
396396
:param r: the missingness indicator index
397-
:param cg_skel_adj: adjacancy matrix of a causal skeleton
397+
:param cg_skel_adj: adjacency matrix of a causal skeleton
398398
:return:
399399
prt: list, parents of the missingness indicator r
400400
"""

causallearn/search/FCMBased/lingam/causal_effect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _get_propagated_effects(self, En, intervention_index, intervention_value):
8080
8181
Parameters
8282
----------
83-
En : array-like, shpae (n_features)
83+
En : array-like, shape (n_features)
8484
Expectations of each noise variable.
8585
intervention_index : int
8686
Index of variable to apply intervention.
@@ -89,7 +89,7 @@ def _get_propagated_effects(self, En, intervention_index, intervention_value):
8989
9090
Returns
9191
-------
92-
propagated_effects : array-like, shpae (n_features)
92+
propagated_effects : array-like, shape (n_features)
9393
Propagated effects, where ``n_features`` is the number of features.
9494
"""
9595
effects = np.zeros(len(self._causal_order))
@@ -106,7 +106,7 @@ def _predict(self, X, pred_model):
106106
107107
Parameters
108108
----------
109-
X : array-like, shpae (n_predictors)
109+
X : array-like, shape (n_predictors)
110110
Predictors, where ``n_predictors`` is the number of variables.
111111
pred_model : model object implementing 'predict' or 'predict_proba'
112112
Model to predict the expectation. For linear regression or non-linear reggression, model object must have ``predict`` method.

causallearn/search/FCMBased/lingam/direct_lingam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _entropy(self, u):
146146
k2 * (np.mean(u * np.exp((-u ** 2) / 2))) ** 2
147147

148148
def _diff_mutual_info(self, xi_std, xj_std, ri_j, rj_i):
149-
"""Calculate the difference of the mutual informations."""
149+
"""Calculate the difference of the mutual information."""
150150
return (self._entropy(xj_std) + self._entropy(ri_j / np.std(ri_j))) - \
151151
(self._entropy(xi_std) + self._entropy(rj_i / np.std(rj_i)))
152152

@@ -215,7 +215,7 @@ def _search_causal_order(self, X, U):
215215
return Uc[np.argmax(M_list)]
216216

217217
def _mutual_information(self, x1, x2, param):
218-
"""Calculate the mutual informations."""
218+
"""Calculate the mutual information."""
219219
kappa, sigma = param
220220
n = len(x1)
221221
X1 = np.tile(x1, (n, 1))

causallearn/search/FCMBased/lingam/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def print_causal_directions(cdc, n_sampling, labels=None):
2424
n_sampling : int
2525
Number of bootstrapping samples.
2626
labels : array-like, optional (default=None)
27-
List of feature lables.
27+
List of feature labels.
2828
If set labels, the output feature name will be the specified label.
2929
"""
3030
for i, (fr, to, co) in enumerate(zip(cdc['from'], cdc['to'], cdc['count'])):
@@ -47,7 +47,7 @@ def print_dagc(dagc, n_sampling, labels=None):
4747
n_sampling : int
4848
Number of bootstrapping samples.
4949
labels : array-like, optional (default=None)
50-
List of feature lables.
50+
List of feature labels.
5151
If set labels, the output feature name will be the specified label.
5252
"""
5353
for i, (dag, co) in enumerate(zip(dagc['dag'], dagc['count'])):

causallearn/search/ScoreBased/ExactSearch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def bic_exact_search(X, super_graph=None, search_method='astar',
6060
dag_est : numpy.ndarray, shape=(d, d)
6161
Estimated DAG.
6262
search_stats : dict
63-
Some statistics related to the seach procedure.
63+
Some statistics related to the search procedure.
6464
"""
6565
n, d = X.shape
6666
if super_graph is None:
@@ -76,7 +76,7 @@ def bic_exact_search(X, super_graph=None, search_method='astar',
7676
if max_parents is None:
7777
max_parents = d
7878

79-
# To store statistics related to the seach procedure
79+
# To store statistics related to the search procedure
8080
search_stats = {}
8181

8282
# Generate parent graphs (without parallel computing)
@@ -102,7 +102,7 @@ def bic_exact_search(X, super_graph=None, search_method='astar',
102102
if verbose:
103103
_logger.info("Finished searching for shortest path.")
104104

105-
# Covnert structures to adjacency matrix
105+
# Convert structures to adjacency matrix
106106
dag_est = np.zeros((d, d))
107107
for i, parents in enumerate(structures):
108108
dag_est[parents, i] = 1
@@ -135,14 +135,14 @@ def astar_shortest_path(parent_graphs, use_path_extension=True,
135135
structures : tuple, shape=(d,)
136136
Optimal parents for each variable.
137137
shortest_path_stats : dict
138-
Some statistics related to the shortest path seach.
138+
Some statistics related to the shortest path search.
139139
"""
140140
d = len(parent_graphs)
141141
opened = PriorityQueue()
142142
closed = set()
143143

144144
if use_k_cycle_heuristic:
145-
# Create pattern databse
145+
# Create pattern database
146146
PD = create_dynamic_pd(parent_graphs, k)
147147
if verbose:
148148
_logger.info('Finished creating pattern database.')
@@ -234,7 +234,7 @@ def dp_shortest_path(parent_graphs, use_path_extension=True, verbose=False):
234234
structures : tuple, shape=(d,)
235235
Optimal parents for each variable.
236236
shortest_path_stats : dict
237-
Some statistics related to the shortest path seach.
237+
Some statistics related to the shortest path search.
238238
"""
239239
d = len(parent_graphs)
240240
order_graph = nx.DiGraph()
@@ -320,7 +320,7 @@ def generate_parent_graph(X, i, max_parents=None, parent_set=None, include_paren
320320
parent_set = tuple(set(parent_set))
321321

322322
if include_parents is None:
323-
include_parents = () # Emptry tuple
323+
include_parents = () # Empty tuple
324324

325325
parent_graph = []
326326
for j in range(len(parent_set) + 1):

causallearn/utils/DAG2CPDAG.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
def dag2cpdag(G: Dag) -> GeneralGraph:
1010
"""
11-
Covert a DAG to its corresponding PDAG
11+
Convert a DAG to its corresponding PDAG
1212
1313
Parameters
1414
----------

causallearn/utils/DAG2PAG.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def dag2pag(dag: Dag, islatent: List[Node]) -> GeneralGraph:
1717
"""
18-
Covert a DAG to its corresponding PAG
18+
Convert a DAG to its corresponding PAG
1919
Parameters
2020
----------
2121
dag : Direct Acyclic Graph

causallearn/utils/KCI/KCI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def get_uuprod(self, Kx, Ky):
520520
Returns
521521
_________
522522
uu_prod: product of the eigenvectors of Kx and Ky
523-
size_u: number of producted eigenvectors
523+
size_u: number of produced eigenvectors
524524
525525
"""
526526
wx, vx = eigh(0.5 * (Kx + Kx.T))
@@ -562,7 +562,7 @@ def null_sample_spectral(self, uu_prod, size_u, T):
562562
Parameters
563563
----------
564564
uu_prod: product of the eigenvectors of Kx and Ky
565-
size_u: number of producted eigenvectors
565+
size_u: number of produced eigenvectors
566566
T: sample size
567567
568568
Returns

causallearn/utils/PCUtils/Helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def recursive_and(L):
5656
for value_config in range(len(value_config_list)):
5757
L = list(zip(conditioning_set, value_config_list[value_config]))
5858
sub_data = recursive_and(L)[:, [X,
59-
Y]] # obtain the subset dataset (containing only the X, Y columns) with only rows specifed in value_config
59+
Y]] # obtain the subset dataset (containing only the X, Y columns) with only rows specified in value_config
6060
6161
# Step 2: Generate contingency table (applying Fienberg's method)
6262
def make_ctable(D, cat_size):
@@ -692,7 +692,7 @@ def get_sub_correlation_matrix(mvdata):
692692
-------
693693
INPUT:
694694
-------
695-
mvdata: data, columns represent variables, rows represnet records/samples
695+
mvdata: data, columns represent variables, rows represent records/samples
696696
-------
697697
OUTPUT:
698698
-------
@@ -711,7 +711,7 @@ def get_indx_complete_rows(mvdata):
711711
-------
712712
INPUT:
713713
-------
714-
mvdata: data, columns represent variables, rows represnet records/samples
714+
mvdata: data, columns represent variables, rows represent records/samples
715715
-------
716716
OUTPUT:
717717
-------

causallearn/utils/PDAG2DAG.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def pdag2dag(G: GeneralGraph) -> GeneralGraph:
1111
"""
12-
Covert a PDAG to its corresponding DAG
12+
Convert a PDAG to its corresponding DAG
1313
1414
Parameters
1515
----------

0 commit comments

Comments
 (0)