Github user mktal commented on the issue:

    https://github.com/apache/incubator-madlib/pull/75
  
    The SQL code used to obtain the above results (note that we assume two 
tables mnist_train and mnist_test already exist in the database):
    
    ```sql
    -- training on mnist_train and store the model in mnist_model
    drop table if exists mnist_model;
    create table mnist_model as
    select
        madlib.structure_svm_step(
                          ind_var::double precision[][],
                          dep_var::double precision[],
                          NULL::double precision[],
                          784::integer, -- number of features
                          10::integer, -- number of classes
                          8::integer, -- epoch
                          64::integer, -- batch_size
                          0.01::double precision, -- step size
                          0.001::double precision, -- regularization
                          1::double precision) as state
    from mnist_train;
    
    -- testing on mnist_test
    select
        1 - miss/total as accuracy
    from (
        select count(*)::float8 as miss
        from mnist_test, mnist_model
        where madlib.structure_svm_predict(state, ind_var) <> dep_var
    ) q, (select count(*)::float8 as total from mnist_test) q2
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to