Predictions
This document provides API documentation for the predict tools.
price_prediction(ticker: str) -> dict
A well trained model that can predict whether a stock's price will be lower than its predicted thresohold price in the next 5 days based on historical data.
Parameters
ticker
(str): The stock ticker symbol (e.g., 'AVGO').
Sample Response
{
"ticker": "AVGO",
"last_close": 327.9,
"lower_bound_percentage": -0.04,
"threshold_price": 315.52,
"label_1_proba": 0.46,
"probability_threshold": 0.63,
"prediction": "may higher than thresohold price",
"model_desc": "Binary classifier: label=1 → price < threshold, label=0 → price ≥ threshold, for the next 5 days prediction.\n Conclusion interpretation: prioritize using the prediction field as the final conclusion.\n Risk judgment: combine label_1_proba with probability_threshold to judge the prediction.\n Reliability reference: refer to the precision, recall, and f1-score in the report to evaluate the reliability of the prediction result.\n potential gain from (Bull Put Spread strategy) = probability of stock price going down * predicted stock price * average loss from a failed prediction\n ",
"report": {
"0": {
"precision": "1.00",
"recall": "0.58",
"f1-score": "0.74"
},
"1": {
"precision": "0.67",
"recall": "1.00",
"f1-score": "0.80"
},
"accuracy": "0.77",
"macro avg": {
"precision": "0.83",
"recall": "0.79",
"f1-score": "0.77"
},
"weighted avg": {
"precision": "0.85",
"recall": "0.77",
"f1-score": "0.77"
}
},
"option_market_implement_prob_go_below": 0.53,
"option_market_implement_prob_go_above": 0.47
}
Returns
dict
: A dictionary with prediction details including current price, thresohold price and confusion matrix report, and the market implementing probability.