-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider configuring "index_predicates" flag in variable definition #1052
Comments
i like this idea. some considerations:
|
I agree, by default don't use index predicates
I would throw an error. Plenty of other variables have params and settings that are specific to them, I view this change as lumping this option in with the other ones.
I think the end goal should be to remove the def train(
self, recall: float = 1.00, **kwargs
) -> None: # pragma: no cover
index_predicates = kwargs.get("index_predicates", None)
if index_predicates is not None:
warnings.warn("the arg deprecated")
if index_predicates:
# override variable config, pretend "index":True was used in all definitions
else:
# override variable config, pretend "index":False was used in all definitions
# continue onwards
After some time, we remove the **kwargs and this logic. This agrees with your suggestions |
Currently, you choose whether or not to use index predicates by passing the
index_predicates
flag inprepare_training()
.This has some drawbacks
if hasattr(predicate, "index")
. It would be better if the Fingerprinter never even received this predicate in the first place. Similar thing in DataModel. It also looks like the BlockLearners know about canopy vs non-canopy predicates, eg when it callsself.data_model.predicates(canopies=False)
, but this might be a separate topic. I don't understand what a canopy index is and why you sometimes would want to use or not use one.What if instead we defined this flag as part of the variable definition? eg
{"field": "name", "type": "ShortString", "index": False}
. Then, the variable itself is responsible for adding or omitting the index predicates, and everything else just accepts this at face value.The text was updated successfully, but these errors were encountered: