curl --request POST \
--url https://api.fincept.in/quantlib/physics/entropy/cross \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"p": [
0,
1,
0,
0
],
"q": [
0.1,
0.7,
0.15,
0.05
],
"base": 2.718281828459045
}
'{
"success": true,
"data": {
"cross_entropy": 1.3254
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}quantlib-physics
Calculate Cross Entropy
Calculates the cross entropy between two probability distributions P and Q, measuring the average number of bits needed to identify an event from P when using a coding scheme optimized for Q. Cross entropy is fundamental in machine learning loss functions and information theory.
Use Cases:
- Evaluate prediction model performance
- Optimize classification models for trading signals
- Compare forecast accuracy
- Information-theoretic model selection
- Assess encoding efficiency
Formula: H(P,Q) = -Σ p(x) log(q(x))
Note: Cross entropy = Shannon entropy + KL divergence
Credits: 5 credits per request (Pro Tier) [Tier: ENTERPRISE, Credits: 10]
POST
/
quantlib
/
physics
/
entropy
/
cross
curl --request POST \
--url https://api.fincept.in/quantlib/physics/entropy/cross \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"p": [
0,
1,
0,
0
],
"q": [
0.1,
0.7,
0.15,
0.05
],
"base": 2.718281828459045
}
'{
"success": true,
"data": {
"cross_entropy": 1.3254
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
application/json
⌘I
