Skip to content

Commit fa5acbb

Browse files
Adapted to changes in scikit-learn v1.8
1 parent a8a4882 commit fa5acbb

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lingam/causal_based_simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class CBSIUnobsCommonCauseLiNGAM(CBSILiNGAM):
668668
def _check_causal_graph(self, causal_graph, X):
669669
try:
670670
# fill nan with zeros
671-
causal_graph = check_array(causal_graph, force_all_finite="allow-nan", copy=True)
671+
causal_graph = check_array(causal_graph, ensure_all_finite="allow-nan", copy=True)
672672

673673
n_features = X.shape[1]
674674
if causal_graph.shape != (n_features, n_features):

lingam/tools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def bootstrap_with_imputation(
8484
Elements which are not NaN are the imputation values.
8585
"""
8686
# check args
87-
X = check_array(X, force_all_finite="allow-nan")
87+
X = check_array(X, ensure_all_finite="allow-nan")
8888

8989
n_sampling = check_scalar(n_sampling, "n_sampling", (numbers.Integral, np.integer), min_val=1)
9090

lingam/utils/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def evaluate_model_fit(adjacency_matrix, X, is_ordinal=None):
957957
"""
958958

959959
# check inputs
960-
adj = check_array(adjacency_matrix, force_all_finite="allow-nan")
960+
adj = check_array(adjacency_matrix, ensure_all_finite="allow-nan")
961961
if adj.ndim != 2 or (adj.shape[0] != adj.shape[1]):
962962
raise ValueError("adj must be an square matrix.")
963963

@@ -1037,7 +1037,7 @@ def calculate_distance_from_root_nodes(adjacency_matrix, max_distance=None):
10371037
adjacency_matrix,
10381038
ensure_min_samples=2,
10391039
ensure_min_features=2,
1040-
force_all_finite="allow-nan",
1040+
ensure_all_finite="allow-nan",
10411041
)
10421042
if adjacency_matrix.shape[0] != adjacency_matrix.shape[1]:
10431043
raise ValueError("adjacency_matrix must be an square matrix.")
@@ -1103,7 +1103,7 @@ def calculate_total_effect(adjacency_matrix, from_index, to_index, is_continuous
11031103
adjacency_matrix,
11041104
ensure_min_samples=2,
11051105
ensure_min_features=2,
1106-
force_all_finite="allow-nan",
1106+
ensure_all_finite="allow-nan",
11071107
)
11081108
if adjacency_matrix.shape[0] != adjacency_matrix.shape[1]:
11091109
raise ValueError(

0 commit comments

Comments
 (0)