필터 지우기
필터 지우기

How to predict values from machine learning model?

조회 수: 15 (최근 30일)
Manny
Manny 2024년 2월 21일
편집: Drew 2024년 2월 22일
Hi everyone
I am new to machine learning and MATLAB. I am not sure what I am doing wrong. I have a table of stock market data called CIV. The table has symbol, date, and CIV. See screenshot from workspace. I want to forecast by symbol and date. For example, for symbol ABC I want forecast for 10 days. For symbol DEF I want 10 day forecast. The underlying data for the symbols will be different b/c the symbols are different. Hopefully this makes sense. If not, I will clarify if needed. I was able to export the trainmodel. How do I tell it that I want to forecast 10 days starting from date X? I created an array of the dates to use for the forecast but I can't figure out how to use it. Here are the dates:
% CREATE ARRAY OF DATES THAT ARE USED FOR FORECASTING
T0 = datetime("today");
T1 = datetime(busdate(T0,1));
T2 = datetime(busdate(T1,1));
T3 = datetime(busdate(T2,1));
T4 = datetime(busdate(T3,1));
T5 = datetime(busdate(T4,1));
T6 = datetime(busdate(T5,1));
T7 = datetime(busdate(T6,1));
T8 = datetime(busdate(T7,1));
T9 = datetime(busdate(T8,1));
T10 = datetime(busdate(T9,1));
ForecastDates = [T1 T2 T3 T4 T5 T6 T7 T8 T9 T10];
Here is how I started the machine learning app:
Here is a screenshot of the variables in my workspace:
Thank you
  댓글 수: 3
Manny
Manny 2024년 2월 21일
One more thing...
MATLAB tells me to use yfit = trainedModel.predictFcn(T) for forecasting but I cannot figure out how to give it an array of dates I created above. Any help is much appreciated.
Manny
Manny 2024년 2월 21일
Hi @KSSV. I entered what I showed in the first screenshot. I picked 'CIV' and then the app automatically picked the response and predictors. I only changed the training data field to 25. I used the learner app to train it.

댓글을 달려면 로그인하십시오.

답변 (1개)

Drew
Drew 2024년 2월 22일
편집: Drew 2024년 2월 22일
The Classification Learner app is not specifically designed for working with time series. To analyze time series, there are several options depending on the requirements of your use case. Here are some of the options:
If this answer helps you, please remember to accept the answer.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by