geffy / tffm

TensorFlow implementation of an arbitrary order Factorization Machine
MIT License
780 stars 176 forks source link

How can I verify the output of a row after loading the model into memory ? #44

Open akshit96 opened 6 years ago

akshit96 commented 6 years ago

I want to manually verify the prediction of a particular testing sample.

Anncastle commented 4 years ago

you can use load_state function and set the number of features to use the model file. For example: model2 = TFFMClassifier( order=2, rank=32, optimizer=tf.train.AdamOptimizer(learning_rate=0.001), n_epochs=3, batch_size=512, init_std=0.01, reg=0.01, input_type='sparse', seed=1 ) model2.core.set_num_features(X_tr.shape[1]) model2.load_state('./tmp/state.tf')

then input your testing sample and get the result