title: Majority Adjustment/Matching for Ground Truth
body: <p>So, I am working on a ground truth for my machine learning algorithm with R. 5 people classified pictures for me. See the df in the picture below.</p>
  
  <p><img src="https://i.stack.imgur.com/1f8RN.png" alt="Text](https://stackover[![Datafram">]<a href="https://i.stack.imgur.com/1f8RN.png" rel="nofollow noreferrer">1</a>flow.com/Dataframe.PNG)</p>
  
  <p>The results seem to be quite depended on the classifier. What I want to do now, is finding a common Ground Truth. Therefore, I want to do an adjustment by majority for most cases. If at least 3 classifiers classified a picture with the same condition, I want the other two which are different, to switch to this majority condition. In the rare case where there is no majority condition, I want to recheck the picture and make the decision myself.</p>
  
  <p>Below find a reproducible example</p>
  
  <pre><code>data &lt;- data.frame(Pic = character(10), class1 = numeric(10), class2 = numeric(10), class3 = numeric(10), class4 = numeric(10), 
                     class5 = numeric(10), check = numeric(10))
  
  data$Pic &lt;- 1:10
  set.seed(1234)
  data$class1 &lt;- sample(1:5,5)
  data$class2 &lt;- sample(1:5,5)
  data$class3 &lt;- sample(1:5,5)
  data$class4 &lt;- sample(1:5,5)
  data$class5 &lt;- sample(1:5,5)
  
  data[5,2:6] &lt;- 5
  data[1,5] &lt;-4
  data[9,5] &lt;- 2
  
  data$check &lt;- ifelse(data$class1 == data$class2 &amp;  data$class1 == data$class3 &amp;
                       data$class1 == data$class4&amp; data$class1 == data$class5, "Good", "delta")
  
  </code></pre>
  
  <p>Any help on is warmly welcome</p>