ValueError: Found array with 0 sample(s) (shape=(0, 13)) while a minimum of 1 is required I am new to this logistic regression and finding this error. Please help.
solver='lbfgs'
def lr_model(X_train, y_train):
    
    # import the LogisticRegression class
    from sklearn.linear_model import LogisticRegression
    
    # create the model object
    model = LogisticRegression()
    
    # fit the model to the training data
    model.fit(X_train, y_train) #error here
    time.sleep(0.1)
    
    #return the fitted model
    return model

# Test
tmp_model = lr_model(X_train[0:12], y_train[0:12] ) #showing error here
print(tmp_model.predict(X_train[4:5]))
print(tmp_model.predict(X_train[5:6]))
It looks like there are no rows in your X_train array or y_train array. Check the shape and contents of X_train using
np.shape(X_train) if X_train is an array or X_train.shape if X_train is a pandas dataframe.
Also, if you are using a pandas dataframe for X_train, you should change tmp_model = lr_model(X_train[0:12], y_train[0:12] ) to tmp_model = lr_model(X_train.iloc[0:12,:], y_train[0:12] )  as this way you are correctly accessing the rows and columns of the pandas dataframe.