Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jackturner83 committed Feb 13, 2024
1 parent 0524f7d commit e2ae841
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/gpt_prediction.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Prediction
"ChatCompletionMessage(content=""To generate a prediction for the next day's closing price based on the provided CSV summary and the linear regression model output, I will take the following approach:\n\n1. Assume simple linear relationships between the 'Average Sentiment', 'Volume', and the 'Close' price of the stock.\n2. Utilize the mean values of 'Average Sentiment' and 'Volume' from the summary as a simplistic reference.\n3. Apply insights from the linear regression output provided.\n\nFrom the summary:\n- The mean 'Average Sentiment' is approximately 0.062635.\n- The mean 'Volume' is around 5.756531e+07.\n\nHowever, specific details about the linear regression equation (coefficients for 'Average Sentiment' and 'Volume') are not provided, making it impossible to precisely apply the linear regression results. Therefore, I'll proceed with an educated assumption that both features ('Average Sentiment' and 'Volume') are positively correlated with the 'Close' price, given their importance in market analysis.\n\nAssuming a simplistic model where the influence of 'Average Sentiment' and 'Volume' on the 'Close' price is linear and both have been averaged out across the dataset, I'm going to respect the overall positive trend suggested by the provided summary statistics. \n\nConsidering the mean 'Close' price from the summary (189.321052) as a reference and noting market dynamics usually follow a broader trend (unless significant anomalies occur), combined with the last known linear regression analysis, I'm making an educated guess.\n\nPrediction for next day's 'Close' price:\n- Given that we have a very rudimentary understanding of the relationship between the variables and no direct access to daily changes or the model's coefficients, and based strictly on the assumption of a somewhat positive market sentiment (mean sentiment > 0), I predict a slight increase from the mean 'Close' price.\n\nTaking into account the information provided and without the ability to perform direct calculations here, my prediction for the next day's closing price, leveraging the average 'Close' and considering potential positive sentiment, would be in the slight uptrend, around **189.5** (USD or the applicable currency), given the positive mean sentiment and no drastic market condition changes indicated. \n\nPlease note, this is a very high-level, generalized prediction based on limited information and not actual data analysis or a precise modeling outcome."", role='assistant', function_call=None, tool_calls=None)"
"ChatCompletionMessage(content=""Based on the data provided, I have performed a linear regression model using the features 'Average Sentiment' and 'Volume' to predict the 'Close' price of the stock for the next day.\n\nHowever, it seems that the data provided is incomplete and does not contain the necessary information to generate an accurate prediction. The dataset only includes 19 data points, which is not sufficient for making reliable predictions.\n\nTo generate a more accurate prediction, it is recommended to have a larger dataset with more historical data. Additionally, other factors such as market trends, economic indicators, and company-specific news should also be considered.\n\nTherefore, without additional data, it is not possible to provide a precise prediction for the next day's closing price."", role='assistant', function_call=None, tool_calls=None)"
4 changes: 2 additions & 2 deletions src/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def make_prediction(combined_summary, linear_regression_summary):
messages=[
{
"role": "system",
"content": "You are a Predictive Modeler. You will be tasked with generating predictive analytics based on data. This involves interpreting the data you've processed and making forecasts, such as predicting stock prices. Your output needs to be a prediction, not a set of instructions. I want you to give me your prediction for the next day. ",
"content": "You are a Predictive Modeler tasked with generating theoretical predictive analytics. Your output should be a hypothetical prediction based on provided data and insights, not real-time analysis or data processing. ",
},
{
"role": "user",
"content": f"Given the attached CSV file named 'combined_data.csv', which contains daily stock prices and average sentiment scores for the last 30 days, please analyze the data to predict the stock's closing price for the next day. The dataset includes the following columns: 'Date', 'Average Sentiment', 'Open', 'High', 'Low', 'Close', 'Volume'. Use the 'Average Sentiment' and 'Volume' as features to predict the 'Close' price.{combined_summary}. Here is the linear regression model I have performed for today to assist you in making predictions. {linear_regression_summary} I want you to return to me a prediction with the 'Date' format.",
"content": f"Given a dataset with daily stock prices and average sentiment scores for the last 30 days, including 'Date', 'Average Sentiment', 'Open', 'High', 'Low', 'Close', 'Volume', please simulate an analysis to predict the stock's closing price for tomorrow. Assume today's date is YYYY-MM-DD, and use 'Average Sentiment' and 'Volume' as key features in your theoretical model. Here's a summary of a linear regression analysis performed today: [insert summary here]. Based on this, predict the closing price for the next day (YYYY-MM-DD+1), focusing on the impact of 'Average Sentiment' and 'Volume'.",
},
],
)
Expand Down

0 comments on commit e2ae841

Please sign in to comment.