@@ -196,6 +196,14 @@ def rename(self,
196
196
entity = self .session .put_resource (path , json , version = self ._api_version )
197
197
return self .build (entity )
198
198
199
+ def generate_feature_effects (self ,
200
+ uid : Union [UUID , str ],
201
+ * ,
202
+ version : Union [int , str ] = MOST_RECENT_VER ) -> GraphPredictor :
203
+ path = self ._construct_path (uid , version , "shapley/generate" )
204
+ self .session .put_resource (path , {}, version = self ._api_version )
205
+ return self .get (uid , version = version )
206
+
199
207
def delete (self , uid : Union [UUID , str ], * , version : Union [int , str ] = MOST_RECENT_VER ):
200
208
"""Predictor versions cannot be deleted at this time."""
201
209
msg = "Predictor versions cannot be deleted. Use 'archive_version' instead."
@@ -578,6 +586,26 @@ def rename(self,
578
586
uid , version = version , name = name , description = description
579
587
)
580
588
589
+ def generate_feature_effects_async (self ,
590
+ uid : Union [UUID , str ],
591
+ * ,
592
+ version : Union [int , str ]) -> GraphPredictor :
593
+ """Begin generation of feature effects.
594
+
595
+ version can be any numerical version (which exists), "latest", or "most_recent". Although
596
+ note that this will fail if the predictor is not already trained.
597
+
598
+ Feature effects are automatically generated for all new predictors after a successful
599
+ training as of the end of 2024. This call allows either regenerating those values, or
600
+ generating them for older predictors.
601
+
602
+ This call just begins the process; generation usually takes a few minutes, but can take
603
+ much longer. As soon as the call completes, the old values will be inaccessible. To wait
604
+ for the generation to complete, and to retrieve the new values once they're ready, use
605
+ GraphPredictor.feature_effects.
606
+ """
607
+ return self ._versions_collection .generate_feature_effects (uid , version = version )
608
+
581
609
def delete (self , uid : Union [UUID , str ]):
582
610
"""Predictors cannot be deleted at this time."""
583
611
msg = "Predictors cannot be deleted. Use 'archive_version' or 'archive_root' instead."
0 commit comments