0
$\begingroup$

I was using 3 functions form scipy: TFIDF vectorizer, Multioutput classifier and Linear SVC.

The code goes like this.

pipe_lr1 = Pipeline(steps=[('cv',TfidfVectorizer()), ('lr_multi',MultiOutputClassifier(LinearSVC()))])

How can I print the values at each step of the function in order to see

  • What was the ouptput of TFIDF vectorizer?
  • What was the output of Linear SVC?
  • What data was coming out of MultioutputClassifier(X)?
$\endgroup$
2

1 Answer 1

0
$\begingroup$

You can access them using the below code. Do what you normally do without using a pipeline.

pipe_lr1.named_steps["cv"]
pipe_lr1.named_steps["lr_multi"]
$\endgroup$
2
  • $\begingroup$ This was not printing any values $\endgroup$
    – User123456
    Nov 14, 2022 at 19:00
  • $\begingroup$ This is not print anything; it gives you access to TfidfVectorizer and MultiOutputClassifier. Then use their functions. For example pipe_lr1.named_steps["cv"].get_feature_names_out() $\endgroup$
    – Niyaz
    Nov 14, 2022 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.