liyinxiao / lambdaranknn Goto Github PK
View Code? Open in Web Editor NEWLambdaRank Neural Network model using Keras.
License: MIT License
LambdaRank Neural Network model using Keras.
License: MIT License
Traceback (most recent call last):
File "/home/administrator/ilabs/GIT/learning2rank/rank/LR_testing.py", line 22, in
rankerNN2pmml(estimator=ranker.model, file='Model_example.xml', **params)
File "/home/administrator/ilabs/GIT/learning2rank/.venv/lib/python3.6/site-packages/rankerNN2pmml/init.py", line 207, in rankerNN2pmml
feature_names = _validate_inputs(estimator, transformer, feature_names)
File "/home/administrator/ilabs/GIT/learning2rank/.venv/lib/python3.6/site-packages/rankerNN2pmml/init.py", line 29, in _validate_inputs
raise TypeError("Provided model is not supported.")
TypeError: Provided model is not supported.
Hello, thanks for sharing the algorithm! I'm just wondering, what do the label numbers actually mean in the example.
Does 0 mean rank position 0; 1 means rank position 1 and so on?
Or 0 actually means irrelevant?
Thanks
I get this error, please check, does qid need to be particular type?
python3.7
bst7 = LambdaRankNN(input_size=X.shape[1], hidden_layer_sizes=(8,4,), activation=('relu', 'relu',), solver='adam')
qid = np.ones(len(train))
bst7.fit(X[train, :], y[train], qid)
Traceback (most recent call last):
File "/home/dnachbar/python/lightgbm/zip.py", line 66, in <module>
bst7.fit(X[train, :], y[train], qid)
File "/home/dnachbar/.local/lib/python3.7/site-packages/LambdaRankNN/__init__.py", line 121, in fit
X1_trans, X2_trans, y_trans, weight = self._transform_pairwise(X, y, qid)
File "/home/dnachbar/.local/lib/python3.7/site-packages/LambdaRankNN/__init__.py", line 287, in _transform_pairwise
original = ((1 << pos_label) - 1) * pos_loginv + ((1 << neg_label) - 1) * neg_loginv
TypeError: ufunc 'left_shift' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Hi @liyinxiao,
Firstly great work, made my life easy to use the Learning2Rank models using Keras.
Few questions I got while using the library:
Any guidance or support is appreciated?
Thanks in advance
Hi! Not sure how to construct the query_id dataset for a user_id+item_id (2 ids) recommendation problem. Is it possible to do with LambdaRankNN? Thanks!
I was trying to run the toy example given in the repo. It is showing below error
Traceback (most recent call last):
File "lamdarank_test.py", line 14, in
ranker = LambdaRankNN(input_size=X.shape[1], hidden_layer_sizes=(16,8,), activation=('relu', 'relu',), solver='adam')
File "/home/user/stellar_env/lib/python3.6/site-packages/LambdaRankNN/init.py", line 243, in init
super(LambdaRankNN, self).init(input_size, hidden_layer_sizes, activation, solver)
File "/home/user/stellar_env/lib/python3.6/site-packages/LambdaRankNN/init.py", line 31, in init
self.model = self._build_model(input_size, hidden_layer_sizes, activation)
File "/home/user/stellar_env/lib/python3.6/site-packages/LambdaRankNN/init.py", line 44, in _build_model
input1 = Input(shape=(input_shape,), name='Input_layer1')
File "/usr/local/lib/python3.6/dist-packages/keras/engine/input_layer.py", line 178, in Input
input_tensor=tensor)
File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/input_layer.py", line 87, in init
name=self.name)
File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 517, in placeholder
x = tf.placeholder(dtype, shape=shape, name=name)
AttributeError: module 'tensorflow' has no attribute 'placeholder'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.