.mat trained model linear svm to android

조회 수: 4 (최근 30일)
Michalis Gelastos
Michalis Gelastos 2021년 3월 9일
댓글: Michalis Gelastos 2021년 4월 18일
Hello, i have trained my data using Linear SVM machine learning from classification learner app in Matlab. Then i exported the model and saved it using .mat extension. Now, i want to import this model into android studio, so i can make the predictions real time from the smartphone. Is there any simple way to do that?

채택된 답변

Sruthi Yenugula
Sruthi Yenugula 2021년 3월 17일

추가 답변 (1개)

Sruthi Yenugula
Sruthi Yenugula 2021년 4월 7일
Hi Michalis Gelastos,
We do not yet have an ECOC Simulink block. For ECOC models (and models for which we do not yet have Simulink blocks), you need to use a MATLAB Function block (or a System block, but MATLAB Function block is more efficient). Here’s an example that should apply to all models:
Our example in Human Activity Recognition demo also uses the MATLAB function block, so this makes me think that the issue is with the exported model from the app; the model exported from the Classification Learner App is not the model itself, but a struct that wraps the model. You can refer to this example to get the model:
So,you extract the model first (and underlying preprocessing code if there is any) and then go to MATLAB function block
  댓글 수: 2
Michalis Gelastos
Michalis Gelastos 2021년 4월 17일
편집: Michalis Gelastos 2021년 4월 17일
I'm trying to save the model from the struct using saveLearnerForCoder and i'm getting this error "Categorical array class labels are not supported for code generation."
Michalis Gelastos
Michalis Gelastos 2021년 4월 18일
I figured out that the results from the trained model were string, so i changed the to numbers and following your previous post, it worked! Thank you very match!

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

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by