Previous question · 1440
Filter Rows by Condition
easyDatabase
Next question · 1442
Total Refund Cost
mediumDatabase
Random coding question

1441. Hard vs soft voting

easy
GeneralGeneral
senior
Function contract
Inputs
pred_labels
np.ndarray
pred_probas
np.ndarray
Returns
value
tuple

Examples

Input
{
  "pred_labels": [
    [
      0,
      1,
      2,
      1
    ],
    [
      1,
      1,
      2,
      0
    ],
    [
      1,
      2,
      2,
      0
    ]
  ],
  "pred_probas": [
    [
      [
        0.6,
        0.3,
        0.1
      ],
      [
        0.2,
        0.5,
        0.3
      ],
      [
        0.1,
        0.2,
        0.7
      ],
      [
        0.1,
        0.6,
        0.3
      ]
    ],
    [
      [
        0.2,
        0.7,
        0.1
      ],
      [
        0.1,
        0.7,
        0.2
      ],
      [
        0.05,
        0.25,
        0.7
      ],
      [
        0.7,
        0.2,
        0.1
      ]
    ],
    [
      [
        0.3,
        0.6,
        0.1
      ],
      [
        0.2,
        0.2,
        0.6
      ],
      [
        0.1,
        0.1,
        0.8
      ],
      [
        0.6,
        0.3,
        0.1
      ]
    ]
  ]
}
Output
[
  [
    1,
    1,
    2,
    0
  ],
  [
    1,
    1,
    2,
    0
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
senior
entry
Tags
ensemble-voting
numpy
multiclass-classification
argmax-tie-breaking

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
20 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python / NumPy environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands