Skip to content
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

Can I pass a feature vector as a param ? #432

Open
msayan-vcbs opened this issue Jun 30, 2022 · 3 comments
Open

Can I pass a feature vector as a param ? #432

msayan-vcbs opened this issue Jun 30, 2022 · 3 comments

Comments

@msayan-vcbs
Copy link

Hi, so I have a desire to use this plugin in an unconventional way. I want to use a pre-trained xgboost model and provide a one hot encoded DenseFeatureVector as a query param which will be used in rescoring all my results, rather than use the FeatureSet framework paradigm.

Is this possible ?

Basically something like:

"rescore": {
    "window_size": 1000,
    "query": {
        "rescore_query": {
            "sltr": {
                "params": {
                    "keywords": "rambo"
                },
                "model": "my_model",
                "active_features": [0.1, 0.2, 0.4, 0.2, ... etc]
            }
        }
    }
}

}

@msayan-vcbs msayan-vcbs changed the title How to use Linear Ranking Directly ? Can I pass a feature vector as a param ? Jun 30, 2022
@nathancday
Copy link
Member

you should be able to pass in various JSON-y objects through params:, don't think functions would work but arrays should

@msayan-vcbs
Copy link
Author

Hi Nathan, thanks for the quick reply.

So looking at the documentation, it looks like it may be possible to 'override' features through the Script Features Param section, correct ?

Would I have to define dummy fields in the feature set to achieve something like what I posted ?

@nathancday
Copy link
Member

I believe a model requires a featureset to be created, so you'd need at least a dummy featureset like you said. Since a model's features already accept params, you'd just be calling sltr with active_features under the params key at the same level at keywords

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants