2
$\begingroup$

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.

$\endgroup$

closed as off-topic by YCor, user44191, Carlo Beenakker, Gerald Edgar, R. van Dobben de Bruyn Oct 9 at 17:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about research level mathematics within the scope defined in the help center." – user44191, Carlo Beenakker, Gerald Edgar, R. van Dobben de Bruyn
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ I would say there should be 0 or 2 commas, but either is acceptable. $\endgroup$ – Mark Grant Oct 9 at 15:30
  • 3
    $\begingroup$ 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. $\endgroup$ – Dan Ramras Oct 9 at 16:32
  • 3
    $\begingroup$ 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. $\endgroup$ – R. van Dobben de Bruyn Oct 9 at 17:44
  • $\begingroup$ 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. $\endgroup$ – RP_ Oct 10 at 7:17