title: Keras image binary classification, which class is assigned probability 0 and 1 ? Using Functional API
body: <p>When implementing binary classification, the <code>sigmoid</code> function is used as activation for the last layer by majority of the people. As I understand the <code>sigmoid</code> function gives a probability between 0 and 1 and we set a threshold value (mostly 0.5) to determine the class label.</p>
  <p>However I'm confused as to which class does is that probability for ? Say I have two classes <code>A</code> and <code>B</code> and I get prediction result <code>p</code> or <code>p%</code> . Is that the probability of <strong>being</strong> class <code>A</code> or the probability of <strong>not</strong> being class <code>A</code> (i.e <code>B</code>).</p>
  <p>I apologize if this has been asked here before but I couldn't find it. Since I'm using <code>Keras Functional API</code> i cannot use the <code>predict_classes()</code> function. Also I mostly use generators for loading my dataset mostly <code>flow_from_dataframe()</code> from <code>ImageDatagenerator</code> in which you can just provide the class labels or class list. In my case it's two strings in my dataframe &quot;REAL&quot; or &quot;FAKE&quot; .</p>
  <p>Also is there a way to set which class I want the probability for ?</p>