SymetryML6.1
  • Introduction
  • Guides
    • Onboarding Guide
    • Technical Requirements
    • Admin User Guide
    • Installation Guide
      • Installation Guide - GPU
      • Installation Guide - Spark
  • SymetryML GUI
    • ML Toolkit
      • The SymetryML Difference
      • Data Mining Lifecycle
      • SymetryML Concepts
      • Data Sources
      • Streams
      • Encoders
      • Projects
      • Models
    • Sequence Models
    • SymetryML Federated Learning
      • Creating the Federation
      • Load data to local project
      • Requesting Federation Information from Admin Node
      • Joining a Federation with a peer node
      • Federated Data & Modelling
      • Appendix
    • DEM Generator
  • SymetryML Rest Client
    • REST API Reference Guide
      • SymetryML REST API Security
      • SymetryML JSON API Objects
      • Encoder Object REST API
      • SymetryML Projects REST API
      • About Federated Learning
      • Hipaa Compliance and Federated Learning
      • Federated Learning API
        • Federated Learning Topologies
        • Federated Learning with Nats
        • Federated Learning with AWS
        • Fusion Projects
      • Exploration API
      • Modeling API
      • Exporting and Importing Model
      • Third Party Model Rest API
      • SymetryML Job Information
      • Prediction API
      • Data Source API
      • Project Data Source Logs
      • Stream Data Source API
      • AutoML with SymetryML
      • Transform Dataframe
      • Select Model with SymetryML
      • Auto Select with SymetryML
      • Tasks API
      • Miscellaneous API
      • WebSocket API
      • Appendix A JSON Data Structure Schema
      • Appendix B Sample Code
  • SymetryML SaaS
    • SaaS Homepage
    • SaaS Dashboard
    • SaaS Account
    • SaaS Users
    • SaaS Licence
Powered by GitBook
On this page
  • Select Model introduction
  • Select Heuristic
  • Selector Types
  • Selector Grid
  • Select Model Rest API
  • URL
  • Query Parameters
  • MLContext Build Parameters
  • HTTP Responses
  • Sample Request Response Classifier
  • Sample Request Response Regression
  • Select Model Dataframe Rest API
  • URL
  • Query Parameters
  • MLContext Build Parameters
  • HTTP Responses
  • Sample Request Response Classifier
  • Sample Request Response Regression
  1. SymetryML Rest Client
  2. REST API Reference Guide

Select Model with SymetryML

PreviousTransform DataframeNextAuto Select with SymetryML

Last updated 2 years ago

Select Model introduction

SymetryML Select Model is a feature selection functionality. It allows to automatically select the best features for a given model algorithm and it leverages SymetryML unique capabilities to build different predictive model quickly. The functionality builds various model each with different input attributes using a predefined heuristic. It then computes a score for them using out of sample data and will retain the best one. The following table describes the available heuristics:

Select Heuristic

Select heuristic

Name

Description

Forward Backward

A heuristic that does the following: 1. Iteratively add as many features as possible while keeping the best model 2. Iteratively remove as many feature as possible while keeping the best model 3. repeat a specific number of time.

Brute Force

Brute force will try all possible combinations of the input attributes. It should not be used if you have more than 17-18 attributes.

Max Number of Iterations

Randomly create a model by trying a specific number of random number of permutations of the features.

Max. Number of Seconds

Randomly create a model by trying a random number of permutations of the features for a maximum number of seconds.

Simple

The simple heuristic starts with one feature and then incrementally adds one additional feature until it tries all the features. It then keeps track of the best model.

Selector Types

Parameter
Description

selector_type_fw_bw

Forward / Backward heuristic. Number of iteration is by default 5. It can be controlled with the selector_max_iterations parameters.

selector_type_simple

Simple heuristic

selector_type_brute

Brute force selector.

selector_type_iteration

A Selector that will either try a specific number of random combination or will try for a specific number of seconds. selector_max_iterations or selector_max_seconds must also be specified with this type of selector

Selector Grid

Elastic Net model has 2 hyper parameters that can be optimized eta and lambda. The auto-select algorithm will try various combinations of these parameters using a grid search. The size of this grid can be controlled via the autoselect_grid_type extra parameter in the request body. Please see this for such an example.

Parameter
Description

autoselect_grid_type_tiny

eta [0, 0.5, 1.0] x lambda [1e-3, 1e-2, 0.1]

autoselect_grid_type_small

eta [0, 0.5, 1.0] x lambda [1e-3, 1e-2, 0.1, 1]

autoselect_grid_type_normal

eta [0, 0.3333, 0.6666, 1.0] x lambda [1e-4, 1e-3, 1e-2, 0.1, 1, 10]

autoselect_grid_type_large

eta [0, 0.2, 0.4, 0.6, 0.8, 1.0] x lambda [1e-9, 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 0.1, 1, 10, 100, 1000]

Select Model Rest API

Allows to invoke the select model functionality by specifying an external data source id as the out of sample data to use for model assessment.

URL

POST /symetry/rest/{cid}/projects/{pid}/selectModel/{dsid} [body=MLContext]

Query Parameters

Parameter
Required / Optional
Description

modelid

Required

ID to assign to the new model.

algo

Required

Algorithm to fit

MLContext Build Parameters

Parameter
Required / Optional
Type
Description

rnd_seed

Optional

Integer

Set the seed of the randomizer

selector_type

Optional

String

autoselect_grid_type

Optional

String

HTTP Responses

HTTP Status Code
HTTP Status Message
Description

202

OK

Job accepted.

400

BAD REQUEST

Unknown SymetryML project. {"statusCode":"BAD_REQUEST","statusString":" + Cannot Find SYMETRYML id[r2] for Customer id [c1]","values":{}}

Sample Request Response Classifier

Request:
POST url="/symetry/rest/c1/projects/p1/selectModel/Iris_rtlm.csv?algo=lda&modelid=lda1

Body:
{
    "targets":[],
    "inputAttributes":[],
    "inputAttributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
    "targetAttributeNames":["Iris_virginica"],
    "extraParameters":{"rnd_seed":"1"}
}

Sample Request Response Regression

Request:
POST url="/symetry/rest/c1/projects/p1/selectModel/Iris_rtlm.csv?algo=mlr&modelid=mlr1

Body:
{
    "targets":[],
    "inputAttributes":[],
    "inputAttributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
    "targetAttributeNames":["sepal_length"],
    "extraParameters":{"rnd_seed":"1"}}

}

Select Model Dataframe Rest API

URL

POST /symetry/rest/{cid}/projects/{pid}/selectModel [body=Map{"dataframe"=DataFrame, "mlcontext"=MLContext}]

Query Parameters

Parameter
Required / Optional
Description

modelid

Required

ID to assign to the new model.

algo

Required

Algorithm to fit

MLContext Build Parameters

Parameter
Required / Optional
Type
Description

rnd_seed

Optional

Integer

Set the seed of the randomizer

selector_type

Optional

String

autoselect_grid_type

Optional

String

HTTP Responses

HTTP Status Code
HTTP Status Message
Description

202

OK

Job accepted.

400

BAD REQUEST

Unknown SymetryML project. {"statusCode":"BAD_REQUEST","statusString":" + Cannot Find SYMETRYML id[r2] for Customer id [c1]","values":{}}

Sample Request Response Classifier

Request:
POST url="/symetry/rest/c1/projects/p1/selectModel?algo=lda&modelid=lda1

Body:
{
    "mlcontext" : {
        "targets":[],
        "inputAttributes":[],
        "inputAttributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
        "targetAttributeNames":["Iris_virginica"],
        "extraParameters":{"rnd_seed":"1"}}
    "dataframe" : {
        "attributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
        "attributeTypes":["C","C","C","C","B","B","B","B","B","B","B","B","B","B","B"]
        "data":[
            ["4.3","3","1.1","0.1","1","0","0","1","1","0","1","0","1","0","0"],
            ["4.8","3","1.4","0.1","1","0","0","1","1","0","1","0","1","0","0"],
            ["4.9","3.1","1.5","0.1","1","0","0","1","1","0","1","0","1","0","0"]
            (...)
            ["7.2","3.6","6.1","2.5","0","1","0","1","0","1","0","1","0","0","1"]
        ],

    }

}

Sample Request Response Regression

Request:
POST url="/symetry/rest/c1/projects/p1/selectModel?algo=mlr&modelid=mlr1

Body:
{
    "mlcontext" : {
        "targets":[],
        "inputAttributes":[],
        "inputAttributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
        "targetAttributeNames":["sepal_length"],
        "extraParameters":{"rnd_seed":"1"}}
    "dataframe" : {
        "attributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],
        "attributeTypes":["C","C","C","C","B","B","B","B","B","B","B","B","B","B","B"]
        "data":[
            ["4.3","3","1.1","0.1","1","0","0","1","1","0","1","0","1","0","0"],
            ["4.8","3","1.4","0.1","1","0","0","1","1","0","1","0","1","0","0"],
            ["4.9","3.1","1.5","0.1","1","0","0","1","1","0","1","0","1","0","0"]
            (...)
            ["7.2","3.6","6.1","2.5","0","1","0","1","0","1","0","1","0","0","1"]
        ],

    }
}

Default is selector_type_fw_bw. Please see and sections for details.

Default is autoselect_grid_type_tiny. Please see for details.

Allows to invoke the select model functionality by using a passed in the request body as the out of sample data to be used for models assessment.

Default is selector_type_fw_bw. Please see and sections for details.

Default is autoselect_grid_type_tiny. Please see for details.

Selector Heuristic
Selector Types
Selector Grid Table
Selector Heuristic
Selector Types
Selector Grid Table
DataFrame
MLContext
section