Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Machine learning load in Android Application

I have a problem with load() method in SVM module. For example if I run code:

try { Uri uri = Uri.fromFile(new File("file:///android_asset/SVM_Bills.xml")); mySvm.load(uri.getPath());
int in = mySvm.get_support_vector_count(); if (in != 0) { Toast.makeText(context,"done loading : " + uri.getPath(), Toast.LENGTH_SHORT).show(); value = (int)mySvm.predict(matOfDescriptor); } else { Toast.makeText(context,"error while loading : " + uri.getPath(), Toast.LENGTH_SHORT).show(); } It give me the error toast message (i.e it goes to else part and show the toast message). Of course SVM was previously trained.

Any help please?

Machine learning load in Android Application

I have a problem with load() method in SVM module. For example if I run code:

try {
    Uri uri = Uri.fromFile(new File("file:///android_asset/SVM_Bills.xml"));
    mySvm.load(uri.getPath()); 
int in = mySvm.get_support_vector_count(); if (in != 0) { Toast.makeText(context,"done loading : " + uri.getPath(), Toast.LENGTH_SHORT).show(); value = (int)mySvm.predict(matOfDescriptor); } else { Toast.makeText(context,"error while loading : " + uri.getPath(), Toast.LENGTH_SHORT).show(); }

It give me the error toast message (i.e it goes to else part and show the toast message). Of course SVM was previously trained.

Any help please?

Machine learning SVM model fails to load in Android Application

I have a problem with load() method in SVM module. For example if I run code:

try {
    Uri uri = Uri.fromFile(new File("file:///android_asset/SVM_Bills.xml"));
    mySvm.load(uri.getPath());          
    int in = mySvm.get_support_vector_count();
    if (in != 0) {
        Toast.makeText(context,"done loading : " + uri.getPath(), Toast.LENGTH_SHORT).show();
        value = (int)mySvm.predict(matOfDescriptor);
    }
    else {
        Toast.makeText(context,"error while loading : " + uri.getPath(), Toast.LENGTH_SHORT).show();
    }

It give me the error toast message (i.e it goes to else part and show the toast message). Of course SVM was previously trained.

Any help please?