if - else if - else statement and brackets

后端 未结 4 637
名媛妹妹
名媛妹妹 2020-11-29 04:11

I understand the usual way to write an \"if - else if\" statement is as follow:

if (2==1) {
  print(\"1\")
} else if (2==2) {
  print(\"2\")
} else {
  print         


        
4条回答
  •  Happy的楠姐
    2020-11-29 04:39

    ifelse has tree parametes, first conditon, second true result and last false result.

    y_pred = ifelse(prob_predict > 0.5,1,0)
    

提交回复
热议问题