Skip to content

Commit

Permalink
Gracefully handle the single-object case in feta_linear
Browse files Browse the repository at this point in the history
  • Loading branch information
timokau committed Sep 25, 2020
1 parent b34e3ef commit 685cdb7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions csrank/core/feta_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ def fit(
self._pre_fit()
# Global Variables Initializer
n_instances, self.n_objects_fit_, self.n_object_features_fit_ = X.shape
if self.n_objects_fit_ < 2:
# Nothing to learn here, model cannot be constructed without any
# instance pairs.
return self
self._construct_model_(self.n_objects_fit_)
init = tf.global_variables_initializer()

Expand Down

0 comments on commit 685cdb7

Please sign in to comment.