Previous question · 1226
First Names Ending in 'a'
easyDatabase
Next question · 1228
Can Place Flowers
easyData Structures
Random coding question

1227. Embedding collapse detection

medium
GeneralGeneral
senior
Function contract
Inputs
threshold
float
embeddings
np.ndarray
Returns
value
tuple

Examples

Input
{
  "threshold": 0.95,
  "embeddings": [
    [
      1,
      0,
      0
    ],
    [
      0.99,
      0.01,
      0
    ],
    [
      0.98,
      0.02,
      0
    ],
    [
      0.97,
      0.03,
      0
    ]
  ]
}
Output
[
  0.9998229770178346,
  true
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
senior
entry
Tags
cosine-similarity
numpy-vectorization
pairwise-metrics
embedding-quality

Similar Questions

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