Skip to content

Commit 52bf6f9

Browse files
authored
Add node_names to GRaSP.py
Signed-off-by: Evie Qiu <65006489+EvieQ01@users.noreply.github.com>
1 parent 5de8ee6 commit 52bf6f9

File tree

1 file changed

+2
-1
lines changed
  • causallearn/search/PermutationBased

1 file changed

+2
-1
lines changed

causallearn/search/PermutationBased/GRaSP.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def grasp(
8181
maxP: Optional[float] = None,
8282
parameters: Optional[Dict[str, Any]] = None,
8383
verbose: Optional[bool] = True,
84+
node_names: Optional[List[str]] = None,
8485
) -> GeneralGraph:
8586
"""
8687
Perform a greedy relaxation of the sparsest permutation (GRaSP) algorithm
@@ -185,7 +186,7 @@ def grasp(
185186
raise Exception("Unknown function!")
186187
score = localScoreClass
187188

188-
node_names = [("x%d" % i) for i in range(p)]
189+
node_names = [("X%d" % (i + 1)) for i in range(p)] if node_names is None else node_names
189190
nodes = []
190191

191192
for name in node_names:

0 commit comments

Comments
 (0)