Borrar filtros
Borrar filtros

Problems with query points

21 visualizaciones (últimos 30 días)
Mark
Mark el 3 de Sept. de 2024 a las 13:10
Comentada: Mark el 3 de Sept. de 2024 a las 14:08
Hi,
I'm having problems with the codes for query points according to the tutorial based on:
I've followed both the tutorial and tried to implement it on my own data, but both instances I run into the exact same issue.
Following the step:
explainer = fit(explainer,tbl,UseParallel=true); % I have tried this both with and without the UseParallel bit
After attempting this, I receive the following error message:
Error using fit
Expected queryPoint to be a row vector.
Error in shapley/fit (line 424)
validateattributes(q, {'double','single','table'},{'row','nonempty'},'fit','queryPoint');
I'm really not sure what the issue is here as neither the tutorial data or my own work at this point. Any help will be greatly appreciated

Respuestas (1)

Steven Lord
Steven Lord el 3 de Sept. de 2024 a las 13:43
According to the information you provided when you asked the question, you're using release R2023b. Looking at the documentation page for the fit method on shapley objects, I see that there was a change to the function in release R2024a that allows multiple query points. Are you trying to pass multiple query points into the function in an earlier release? I don't think that's going to work. To check this, try running the examples on the documentation page for the documentation installed with your release (or in the release R2023b documentation online) and see if it works with those examples.
If that doesn't explain the behavior you're seeing, what is the size and class of the tbl variable you're passing into the fit function as the second input?
  1 comentario
Mark
Mark el 3 de Sept. de 2024 a las 14:08
Hi Steven,
Thank you for your reply.
I'm not sure what the purpose of the query points is as I've seen no mention of it on the document page I linked, at least for the section I'm trying to do. (Side note, I'm just having problems with them anyway when it comes to classification and have asked a seperate question).
But as you suggested, I have tried to follow the examples that are provided as well as my own and in both instances ran into the same error at the same point. In my case, the tbl variable I am using is an 86x19 table consisting of purely numerical predictors.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by