In Pipeline video, at estimator Variable, am not a...

Discussion in 'General Discussions' started by vishwasourab05, Mar 9, 2018.

  1. vishwasourab05

    Alumni

    Joined:
    Jan 31, 2018
    Messages:
    2
    Likes Received:
    0
    In Pipeline video, at estimator Variable, am not able to put the estimators in a pipeline object( showing this error:
    TypeError: All intermediate steps should be transformers and implement fit and transform. 'LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,
    intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,
    penalty='l2', random_state=None, solver='liblinear', tol=0.0001,
    verbose=0, warm_start=False)' (type <class 'sklearn.linear_model.logistic.LogisticRegression'>) doesn't
    )

    If I remove the Linear Regression in the chain of estimator, Then,am able to put estimators in the pipeline object. Could anyone please explain this?
     
    #1
  2. K Manoj

    K Manoj Moderator
    Staff Member Simplilearn Support

    Joined:
    Aug 4, 2017
    Messages:
    241
    Likes Received:
    22
    Please post the code along with the error screenshot.
     
    #2
  3. MANDALA VISHAL RAO

    Joined:
    May 16, 2018
    Messages:
    9
    Likes Received:
    0
    Same error for me too.
    How to share a screenshot????
     
    #3
  4. Jerry Cote

    Jerry Cote Member

    Joined:
    May 31, 2018
    Messages:
    5
    Likes Received:
    0
    Can you explain why a pipeline cannot combine a linear and a logistic regression in series? I have the same error as the other two entries here and find that the pipeline can follow the PCA reduction with either a linear or logistic regression, but not both, not one following the other
     
    #4
  5. K Manoj

    K Manoj Moderator
    Staff Member Simplilearn Support

    Joined:
    Aug 4, 2017
    Messages:
    241
    Likes Received:
    22
    That is simply because linear & logistic regression are used in completely different settings: the former is for regression (i.e. numeric prediction) problems, while the latter is for classification ones.

    Once you have understood & comprehended this fundamental point, you should be able to convince yourself that, indeed, it makes absolutely no sense to "combine" the two methods in series...
     
    #5
    _33573 likes this.
  6. _33573

    _33573 Member

    Joined:
    Jun 29, 2018
    Messages:
    2
    Likes Received:
    0
    Thanks Manoj
     
    #6

Share This Page