3

Consider the following sentence that introduces a symbol, $f$, used later in the text (not shown):

A classifier is a function $f$, which takes an image as input and produces a label as output.

Should there be a comma before $f$? That is, should it say:

A classifier is a function, $f$, which takes an image as input and produces a label as output.

R.P.
  • 4,745
PThomasCS
  • 389
  • 2
    I would say there should be 0 or 2 commas, but either is acceptable. – Mark Grant Oct 09 '19 at 15:30
  • 3
    It's worth noting that usually "which" follows a comma but and without the comma "that" is more standard. Note that the name $f$ is hardly important here in terms of the meaning of the sentence, and without it "A classifier is a function that..." has a different sense than "A classifier is a function, which...". The latter makes it sounds as though you're saying that a classifier and a function are the same thing, and then you're discussing their (common) nature. The former sounds like you're selecting out a certain type of function, and calling it a classifier. – Dan Ramras Oct 09 '19 at 16:32
  • 3
    The clause is restrictive, so it should be 'that' and not 'which'. There should be no comma. This is a convention of English writing, not mathematics. – R. van Dobben de Bruyn Oct 09 '19 at 17:44
  • Although the restrictive use of 'which' is extremely common and not really 'wrong'.I'd actually prefer it in a definition since it seems more formal to me. But I'd drop the commas. – R.P. Oct 10 '19 at 07:17

0 Answers0