Consider the case where a user who wants to manipulate an attribute’s value before using it in training. To begin, the user can request the list of transformers available at the service:

GET http://example.org/transform
200 OK
{
    "psiType":   "resource-list",
    "uri":       "http://example.org/transform",
    "resources": [
        "http://example.org/transform/square",
        "http://example.org/transform/average"
    ]
}

This indicates there are two transformers available. Requesting a representation of the first produces the following:

GET http://example.org/transform/square
200 OK
{
    "psiType":      "transformer", 
    "uri":          "http://example.org/transform/square",
    "description":  "Calculates the square of a number",
    "accepts":      "$number",
    "emits":        "$number",
    "provenance": {
        "created":   "2013-08-15T09:00Z",
        "createdBy": "system"
    }
}

This response indicates that the transformer calculates the squares of real-valued numbers. This behaviour can be tested by requesting the transformer’s value for the input 4:

GET http://example.org/transform/square?value=4
200 OK
{
    "psiType":  "value",
    "value":    16.0
}

Transforming an attribute’s value

To transform all of the values of the Iris relation’s attribute for sepal length, a join request must first be sent via POST to that attribute’s URI:

POST http://example.org/data/iris/flower/sepal/length
{
    "psiType":  "composition",
    "join":     "http://example.org/transform/square"
}
201 Created
Location: http://example.org/data/iris/flower/sepal/length?t=W1sidC9zcXVhcmUiLCIkbnVtYmVyIl1d

This example service encodes transformer joins as a URI query argument, but any naming scheme is allowed. A normal request to apply the transformed attribute to all instances is then made (the ellipsis indicates omitted values):

GET http://example.org/data/iris/flower/sepal/length?t=W1sidC9zcXVhcmUiLCIkbnVtYmVyIl1d&instance=all
200 OK
{
    "psiType":   "value",
    "valueList": [ 
        26.01, 24.01, 22.09, ..., 38.44, 34.81
    ]
}

The same process of joining an attribute with a transformer can also be used to create an attribute that makes predictions about the data in its relation.

Next steps

This new, transformed attribute could now be used in learning. However, later training examples consider the case where the untransformed attribute values are used instead. Now let’s discover what learning algorithms are available at the service.

Discovering a PSI service Examining a relation and its attributes Discovering available learning algorithms