I have a dataframe in the following format:
colunas = [
'COMEDY',
'CRIME',
'Classe Prevista'
]
precisao_df = pd.DataFrame(columns=colunas)
precisao_df['COMEDY'] = y_pred_proba[:,0]
precisao_df['CRIME'] = y_pred_proba[:,1]
precisao_df
And I want to do the following: for each line, if comedy > crime, expected class = comedy, otherwise crime. That is, the predicted class is what my model was most likely to be. How can I make this expression?
Ex:
COMEDY CRIME Classe prevista
0 0.9 0.1 COMEDY
1 0.42 0.58 CRIME