code: def main(readcsv=pd_read_csv):
      nFeatures = 6
      nClasses = 5
      nIterations = 1000
      stepLength = 1.0e-4
  
      data_path = Path(__file__).parent / "data" / "batch"
      infile = data_path / "logreg_train.csv"
  
      # Read the data
      data = readcsv(infile, range(nFeatures))
      dep_data = readcsv(infile, range(nFeatures, nFeatures + 1))
      nVectors = data.shape[0]
  
      # configure a function
      func = d4p.optimization_solver_cross_entropy_loss(
          nClasses, nVectors, interceptFlag=True
      )
      func.setup(data, dep_data)
  
      # configure a algorithm
      stepLengthSequence = np.array([[stepLength]], dtype=np.double)
      alg = d4p.optimization_solver_lbfgs(
          func,
          stepLengthSequence=stepLengthSequence,
          nIterations=nIterations,
      )
  
      # do the computation
      nParameters = nClasses * (nFeatures + 1)
      initialPoint = np.full((nParameters, 1), 0.001, dtype=np.double)
      res = alg.compute(initialPoint)
  
      # result provides minimum and nIterations
      assert res.minimum.shape == (nParameters, 1)
      assert res.nIterations[0][0] <= nIterations
  
      return res
  
imports: from pathlib import Path
  import numpy
  from readcsv import pd_read_csv
  import daal4py
label_desc: Use image node_id 1 for calling a global function with example usage: main(readcsv) and returns: res