# Set\_transform vs with\_transform

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fset-transform-vs-with-transform%2F20326%3E%5C
**Category:** Beginners\
**Created:** [July 13, 2022, 10:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fset-transform-vs-with-transform%2F20326 "2022-07-13T10:38:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Talha](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Talha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FTalha)%5C
**Post date:** [July 13, 2022, 10:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fset-transform-vs-with-transform%2F20326%2F1 "2022-07-13T10:38:38Z")

</div>

In huggingface dataset, i found two ways of transformation. [with\_transform](https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.with_transform) and [set\_transform](https://huggingface.co/docs/datasets/v2.3.2/en/package_reference/main_classes#datasets.Dataset.set_transform)  
What is the difference between two and which one to use in image classification

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [July 13, 2022, 11:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fset-transform-vs-with-transform%2F20326%2F2 "2022-07-13T11:49:35Z")

</div>

Hi! The only difference is that `set_transform` modifies a dataset in-place and `with_transform` returns a new dataset with the specified transform. Which of these two approaches you want to use is up to you.
