Feature-classifier fit-classifier-naive-bayes problem.

Hi, I have a problem. I tried to use the code below, but I keep getting the same error every time.

qiime feature-classifier fit-classifier-naive-bayes \

--i-reference-reads ref-seqs.qza
--i-reference-taxonomy ref-taxonomy.qza
--o-classifier classifier.qza
--p-feat-ext--ngram-range [7, 7]

(1/1) Got unexpected extra argument (7])

I tried using '[7, 7]', '7, 7', and (7, 7), but I am still getting the same error. What could be the problem?

Hi @do_gry,

Welcome to the :qiime2: forum!

Did you make sure to include a \ after each line in your command?

Hi, thanks for your answer, but my code included a \ at the end without the last.

Hello @do_gry,

What shell are you using, and what operating system?

On Mac Ventura 13.4 with zsh I do not have a problem running this command like this:
--p-feat-ext--ngram-range '[7, 7]'.

The only way I get your error message is if I escape the brackets and don't use quotes:
--p-feat-ext--ngram-range \[7, 7\].

Either way, since [7, 7] is the default, you can just not include this option and get the same result.

I am using Ubuntu 16.04 and Python 3.8? Maybe Python is responsible for this problem?

Hi @do_gry,

It would be highly unlikely that Python would be responsible for this problem, especially at version 3.8 - this is the version that many people are using, and the current version that QIIME 2 depends on. Have you tried what @colinvwood suggested and excluded that parameter (since [7, 7] is the default)?

"Yes, I tried with default, but that doesn't work for me. I got the same error."

Hello @do_gry,

Just to be clear, when you say you tried with the default, you mean that you removed this option altogether?

Hi @do_gry,

That's quite surprising. If you don't mind, please run this again (just copy/paste the command I've provided below) and copy/paste the entire output in your response. Thanks! :lizard:

qiime feature-classifier fit-classifier-naive-bayes \
--i-reference-reads ref-seqs.qza \
--i-reference-taxonomy ref-taxonomy.qza \
--o-classifier classifier.qza \

So, thank you for your help. I finally changed the version of scikit-learn from 1.3.0 to Version 0.24.1, and everything works perfectly. :blush:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.