= keras_linear_model(
klm =10,
number_documents_per_query=5
number_features )
ranking
Reference API related to the ranking framework
keras_linear_model
keras_linear_model (number_documents_per_query, number_features)
linear model with a lasso constrain on the kernel weights.
Type | Details | |
---|---|---|
number_documents_per_query | Number of documents per query to reshape the listwise prediction. | |
number_features | Number of features used per document. | |
Returns | Sequential | The uncompiled Keras model. |
Usage:
keras_lasso_linear_model
keras_lasso_linear_model (number_documents_per_query, number_features, l1_penalty, normalization_layer:Optional=None)
linear model with a lasso constrain on the kernel weights.
Type | Default | Details | |
---|---|---|---|
number_documents_per_query | Number of documents per query to reshape the listwise prediction. | ||
number_features | Number of features used per document. | ||
l1_penalty | Controls the L1-norm penalty. | ||
normalization_layer | typing.Optional | None | Initialized normalization layers. Used when performing feature selection. |
Returns | Sequential | The uncompiled Keras model. |
Usage:
= keras_lasso_linear_model(
kllm =10,
number_documents_per_query=5,
number_features=0.01
l1_penalty )
keras_ndcg_compiled_model
keras_ndcg_compiled_model (model, learning_rate, top_n)
Compile listwise Keras model with NDCG stateless metric and ApproxNDCGLoss
Details | |
---|---|
model | Uncompiled Keras model |
learning_rate | Learning rate used in the Adagrad optim algo. |
top_n | Top n used when computing the NDCG metric |
Usage:
= keras_ndcg_compiled_model(
compiled_klm =klm,
model=0.1,
learning_rate=10
top_n )
LinearHyperModel
LinearHyperModel (number_documents_per_query, number_features, top_n=10, learning_rate_range=None)
Define a KerasTuner search space for linear models
= LinearHyperModel(
linear_hyper_model =10,
number_documents_per_query=10,
number_features=10,
top_n=[1e-2, 1e2]
learning_rate_range )
LassoHyperModel
LassoHyperModel (number_documents_per_query, number_features, trained_normalization_layer, top_n=10, l1_penalty_range=None, learning_rate_range=None)
Define a KerasTuner search space for lasso models
ListwiseRankingFramework
ListwiseRankingFramework (number_documents_per_query, batch_size=32, shuffle_buffer_size=1000, tuner_max_trials=3, tuner_executions_per_trial=1, tuner_epochs=1, tuner_early_stop_patience=None, final_epochs=1, top_n=10, l1_penalty_range=None, learning_rate_range=None, folder_dir='/home/runner/work/learntorank- DEPRECATED/learntorank-DEPRECATED')
Listwise ranking framework