# Sample-classifier input table

**URL:** <https://forum.qiime2.org/t/sample-classifier-input-table/24707>\
**Category:** User Support\
**Tags:** sample-classifier\
**Created:** [November 9, 2022, 11:18am UTC](https://forum.qiime2.org/t/sample-classifier-input-table/24707 "2022-11-09T11:18:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [November 9, 2022, 11:18am UTC](https://forum.qiime2.org/t/sample-classifier-input-table/24707/1 "2022-11-09T11:18:34Z")

</div>

Dear all,  
Currently I am playing with sample-classifier and try to predict metadata categorical values with sample-classifier.

This pipeline takes as input table (frequency) with absolute values.  
My question is how (if) counts are normalized before the classifier training. Is it making sense to use relative frequencies or another normalization output instead?

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [November 10, 2022, 3:26pm UTC](https://forum.qiime2.org/t/sample-classifier-input-table/24707/4 "2022-11-10T15:26:47Z")

</div>

Hi @timanix ,

> [@timanix](#):
>
> My question is how (if) counts are normalized before the classifier training.

No normalization is done by this action. The idea is to eventually implement separate normalization actions that could then pass normalized tables to this function or elsewhere. However, it is not so simple 😁

> [@timanix](#):
>
> Is it making sense to use relative frequencies or another normalization output instead?

Not necessarily. It depends on the properties of the classifier. Many normalization methods for compositional data were designed for differential abundance tests, and their appropriate application to supervised classification problems is still an open question (see [https://doi.org/10.1093/gigascience/giz107](https://doi.org/10.1093/gigascience/giz107)).

Knights et al. ([https://academic.oup.com/femsre/article/35/2/343/661201](https://academic.oup.com/femsre/article/35/2/343/661201)) recommend rarefying prior to classification to avoid introducing library size biases, so this is one option (as a rarefied table is still `FeatureTable[Frequency]`).

---

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [November 10, 2022, 3:46pm UTC](https://forum.qiime2.org/t/sample-classifier-input-table/24707/5 "2022-11-10T15:46:14Z")

</div>

Thank you for the answer!  
I will rarefy the tables, since the only variable I can predict now with high confidence is sequencing run 😆  
Meanwhile the factor of the interest is giving me only 0.4 accuracy with 3 levels.

I will also try to run it with DESeq2-like normalisation (rounded) to see if it will affect the model.

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [December 11, 2022, 9:47pm UTC](https://forum.qiime2.org/t/sample-classifier-input-table/24707/6 "2022-12-11T21:47:14Z")

</div>

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