Azzera filtri
Azzera filtri

Error Troubleshooting Classification Models

2 visualizzazioni (ultimi 30 giorni)
Alexander
Alexander il 25 Apr 2023
Commentato: Kevin Holly il 26 Apr 2023
Im getting this error when i run my code
This is the code i am running
data = readmatrix('project.xlsx')
Tbl = array2table(data);
varNames = ["Number","Amplitude","PSD","Recurrence_Rate","Recurrance_Points","Determinism","Ratio_Determinism_Recurrence_Rate","Average_Diagonal_Length","Average_Vertical_Length","Laminarity","Divergence","Entropy","Trapping_Time","OSA_Label"];
mdl = fitcdiscr(Tbl, Number)
Please help troubleshoot this

Risposte (1)

Kevin Holly
Kevin Holly il 25 Apr 2023
Modificato: Kevin Holly il 25 Apr 2023
I believe you meant this:
mdl = fitcdiscr(Tbl, "Number")
instead of
mdl = fitcdiscr(Tbl, Number)
Edit: Also what does your table look like? Does it have those variable names?
  6 Commenti
Alexander
Alexander il 25 Apr 2023
i am now getting an error that says X and Y do not have the same number of observations
Kevin Holly
Kevin Holly il 26 Apr 2023
Is it possible that you can share your Excel sheet or one with similar data?

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by