Previous question · 206
Cosine similarity for text
easyML Coding
Next question · 208
Find Fifth Largest Salary
easyDatabase
Random coding question

207. Sin and cosine feature encoding

easy
GeneralGeneral
senior
Function contract
Inputs
period
float
values
np.ndarray
Returns
value
tuple

Examples

Input
{
  "period": 24,
  "values": [
    0,
    6,
    12,
    18
  ]
}
Output
[
  [
    0,
    1,
    1.2246467991473532e-16,
    -1
  ],
  [
    1,
    6.123233995736766e-17,
    -1,
    -1.8369701987210297e-16
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Analytics Engineer
Companies
GeneralGeneral
Levels
senior
entry
Tags
cyclical-features
sinusoidal-encoding
numpy-vectorization
feature-engineering

Similar Questions

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