<div dir="ltr">Thank you, Andreas.<div><br></div><div>When I try</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pipe_lr.named_steps['clf'].coef_</blockquote><div><br></div><div>I get:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">AttributeError: 'LogisticRegression' object has no attribute 'coef_'</blockquote><div><br></div><div>And when I try:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pipe_lr.named_steps['clf']</blockquote><div><br></div><div>I get:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">LogisticRegression(C=0.1, 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)</blockquote><div><br></div><div>I wonder what I am missing?</div><div><br></div><div>Thanks,</div><div>Raga</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 28, 2017 at 12:01 PM, Andreas Mueller <span dir="ltr"><<a href="mailto:t3kcit@gmail.com" target="_blank">t3kcit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Can can get the coefficients on the scaled data with<br>
    pipeline_lr.named_steps_['clf'<wbr>].coef_<br>
    though<br>
    <br>
    <br>
    <div class="m_-8097638935145558044moz-cite-prefix">On 08/28/2017 12:08 AM, Raga Markely
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">No problem, thank you!
        <div><br>
        </div>
        <div>Best,</div>
        <div>Raga</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Aug 28, 2017 at 12:01 AM, Joel
          Nothman <span dir="ltr"><<a href="mailto:joel.nothman@gmail.com" target="_blank">joel.nothman@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>No, we do not have a way to get the coefficients with
                respect to the input (pre-scaling) space.</div>
            </div>
            <div class="gmail_extra"><br>
              <div class="gmail_quote">
                <div>
                  <div class="m_-8097638935145558044h5">On 28 August 2017 at 13:20, Raga
                    Markely <span dir="ltr"><<a href="mailto:raga.markely@gmail.com" target="_blank">raga.markely@gmail.com</a>></span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="m_-8097638935145558044h5">
                      <div dir="ltr">Hello,
                        <div><br>
                        </div>
                        <div>I am wondering if it's possible to get the
                          weight coefficients of logistic regression
                          from a pipeline?</div>
                        <div><br>
                        </div>
                        <div>For instance, I have the followings:</div>
                        <div>
                          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">clf_lr =
                            LogisticRegression(penalty='l1<wbr>', C=0.1)<br>
                            pipe_lr = Pipeline([['sc',
                            StandardScaler()], ['clf', clf_lr]])<br>
                            pipe_lr.fit(X, y)</blockquote>
                        </div>
                        <div><br>
                        </div>
                        <div>Does pipe_lr have an attribute that I can
                          call to get the weight coefficient?</div>
                        <div><br>
                        </div>
                        <div>Or do I have to get it from the classifier
                          as follows?</div>
                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">X_std =
                          StandardScaler().fit_transform<wbr>(X)<br>
                          clf_lr = LogisticRegression(penalty='l1<wbr>',
                          C=0.1)<br>
                          clf_lr.fit(X_std, y)<br>
                          clf_lr.coef_</blockquote>
                        <div><br>
                        </div>
                        <div>Thank you,</div>
                        <div>Raga</div>
                        <div><br>
                        </div>
                      </div>
                      <br>
                    </div>
                  </div>
                  ______________________________<wbr>_________________<br>
                  scikit-learn mailing list<br>
                  <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
                  <a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            scikit-learn mailing list<br>
            <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
            <a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="m_-8097638935145558044mimeAttachmentHeader"></fieldset>
      <br>
      <pre>______________________________<wbr>_________________
scikit-learn mailing list
<a class="m_-8097638935145558044moz-txt-link-abbreviated" href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>
<a class="m_-8097638935145558044moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>