code: def logistic_predictor_from_data(train_targets, train_regressors):
      """Fit a statsmodel logistic predictor on supplied data"""
      logit = sm.Logit(train_targets, train_regressors)
      predictor = logit.fit(disp=0)
      # print(predictor.summary())
      return predictor
  
imports: import logging
  import collections
  import io
  import re
  import tarfile
  import os.path
  import smart_open
  import gensim.utils
  import multiprocessing
  from collections import OrderedDict
  import gensim.models.doc2vec
  from gensim.models.doc2vec import Doc2Vec
  from gensim.test.test_doc2vec import ConcatenatedDoc2Vec
  import numpy
  import statsmodels.api
  from random import sample
  from collections import defaultdict
  from random import shuffle
  import random
  import random
  from gensim.test.utils import datapath
label_desc: Use image node_id 4 for calling a global function with example usage: logistic_predictor_from_data(train_targets, train_regressors) and returns: predictor