Previous question · 759
Order Movies By Runtime
easyDatabase
Next question · 761
Swapping Nodes in a Linked List
mediumData Structures
Random coding question

760. Cost sensitive evaluation

medium
GeneralGeneral
senior
Function contract
Inputs
y_pred
np.ndarray
y_true
np.ndarray
cost_matrix
np.ndarray
Returns
value
float

Examples

Input
{
  "y_pred": [
    0,
    1,
    1,
    2,
    1,
    0
  ],
  "y_true": [
    0,
    0,
    1,
    1,
    1,
    2
  ],
  "cost_matrix": [
    [
      0,
      5,
      10
    ],
    [
      2,
      0,
      3
    ],
    [
      4,
      1,
      0
    ]
  ]
}
Output
2

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
senior
entry
Tags
confusion-matrix
cost-sensitive-learning
numpy
multiclass-classification

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
26 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