Skip to content

Instantly share code, notes, and snippets.

@ludovicc
Created March 24, 2016 14:18
Show Gist options
  • Save ludovicc/045ccfba464a99d7cff0 to your computer and use it in GitHub Desktop.
Save ludovicc/045ccfba464a99d7cff0 to your computer and use it in GitHub Desktop.
{
"name": "t_SNE",
"doc": "t-Distributed Stochastic Neighbor Embedding,\na technique for dimensionality reduction.\n",
"metadata": {
"docker_image": "hbpmip/r-tsne:latest"
},
"input": {
"type": "null"
},
"output": {
"doc": "New representation for the data",
"type": "array",
"items": {
"type": "record",
"name": "ReducedData",
"fields": [
{
"name": "1",
"type": "double",
"doc": "Reduced dimension 1"
},
{
"name": "2",
"type": "double",
"doc": "Reduced dimension 2"
},
{
"name": "prov",
"type": {
"type": "enum",
"name": "Enumprov",
"symbols": [
"AD1",
"AD2"
]
},
"doc": "Variable prov"
},
{
"name": "age",
"type": "double",
"doc": "Variable age"
}
]
}
},
"cells": {
"query": {
"type": {
"doc": "Definition of the query that has produced this model",
"name": "Query",
"type": "record",
"fields": [
{
"name": "variables",
"doc": "List of dependent variables",
"type": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "covariables",
"doc": "List of explanatory variables",
"type": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "grouping",
"doc": "List of groupings",
"type": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "parameters",
"doc": "Additional parameters for tSNE function",
"type": {
"type": "record",
"name": "AdditionalParameters",
"fields": [
{
"name": "dims",
"type": "int",
"doc": "Output dimensionality"
},
{
"name": "initial_dims",
"type": "int",
"doc": "the number of dimensions that should be retained in the initial PCA step"
},
{
"name": "perplexity",
"type": "double",
"doc": "Perplexity parameter"
},
{
"name": "theta",
"type": "double",
"doc": "Speed/accuracy trade-off"
},
{
"name": "pca",
"type": "boolean",
"doc": "Whether an initial PCA step should be performed"
},
{
"name": "max_iter",
"type": "int",
"doc": "Maximum number of iterations"
}
]
}
},
{
"name": "sql",
"type": "string",
"doc": "SQL query"
},
{
"name": "count",
"type": "int",
"doc": "Number of records selected by the query"
}
]
},
"init": {
"variables": [
"age"
],
"covariables": [
"left_amygdala",
"left_splsupparlob",
"right_poparoper",
"right_pogpostcgyr"
],
"grouping": [
"prov"
],
"parameters": {
"dims": 2,
"initial_dims": 50,
"perplexity": 1,
"theta": 0.5,
"pca": true,
"max_iter": 1000
},
"sql": "select * from brain",
"count": 9
}
},
"reduced_data": {
"type": {
"doc": "New representation for the data, with the covariables projected to N dimensions, where N is the dims parameter\nand groupings added for visualisation and further processing\n",
"type": "array",
"items": {
"type": "record",
"name": "ReducedData",
"fields": [
{
"name": "1",
"type": "double",
"doc": "Reduced dimension 1"
},
{
"name": "2",
"type": "double",
"doc": "Reduced dimension 2"
},
{
"name": "prov",
"type": {
"type": "enum",
"name": "Enumprov",
"symbols": [
"AD1",
"AD2"
]
},
"doc": "Variable prov"
},
{
"name": "age",
"type": "double",
"doc": "Variable age"
}
]
}
},
"init": [
{
"1": -17.11878893,
"2": -102.96461404,
"prov": "AD1",
"age": 81.2
},
{
"1": 288.97005935,
"2": 198.74859944,
"prov": "AD1",
"age": 81.2
},
{
"1": -24.82965194,
"2": -84.44473342,
"prov": "AD1",
"age": 81.2
},
{
"1": -36.26630739,
"2": -56.97799786,
"prov": "AD1",
"age": 73.6
},
{
"1": 306.68069692,
"2": 243.7006467,
"prov": "AD1",
"age": 73.6
},
{
"1": 299.5901311,
"2": 225.99492791,
"prov": "AD1",
"age": 73.6
},
{
"1": -5.52277366,
"2": -130.82548993,
"prov": "AD1",
"age": 73.6
},
{
"1": -405.99128461,
"2": -137.37420226,
"prov": "AD2",
"age": 70.1
},
{
"1": -405.51208084,
"2": -155.85713656,
"prov": "AD2",
"age": 70.1
}
]
}
},
"action": [
{
"cell": "reduced_data"
}
]
}
@jpivarski
Copy link

Here's a corrected version:

{
  "name": "t_SNE",
  "doc": "t-Distributed Stochastic Neighbor Embedding,\na technique for dimensionality reduction.\n",
  "metadata": {
    "docker_image": "hbpmip/r-tsne:latest"
  },
  "input": {
    "type": "null"
  },
  "output": {
    "doc": "New representation for the data",
    "type": "array",
    "items": {
      "type": "record",
      "name": "ReducedData",
      "fields": [
        {
          "name": "1",
          "type": "double",
          "doc": "Reduced dimension 1"
        },
        {
          "name": "2",
          "type": "double",
          "doc": "Reduced dimension 2"
        },
        {
          "name": "prov",
          "type": {
            "type": "enum",
            "name": "Enumprov",
            "symbols": [
              "AD1",
              "AD2"
            ]
          },
          "doc": "Variable prov"
        },
        {
          "name": "age",
          "type": "double",
          "doc": "Variable age"
        }
      ]
    }
  },
  "cells": {
    "query": {
      "type": {
        "doc": "Definition of the query that has produced this model",
        "name": "Query",
        "type": "record",
        "fields": [
          {
            "name": "variables",
            "doc": "List of dependent variables",
            "type": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "covariables",
            "doc": "List of explanatory variables",
            "type": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "grouping",
            "doc": "List of groupings",
            "type": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "parameters",
            "doc": "Additional parameters for tSNE function",
            "type": {
              "type": "record",
              "name": "AdditionalParameters",
              "fields": [
                {
                  "name": "dims",
                  "type": "int",
                  "doc": "Output dimensionality"
                },
                {
                  "name": "initial_dims",
                  "type": "int",
                  "doc": "the number of dimensions that should be retained in the initial PCA step"
                },
                {
                  "name": "perplexity",
                  "type": "double",
                  "doc": "Perplexity parameter"
                },
                {
                  "name": "theta",
                  "type": "double",
                  "doc": "Speed/accuracy trade-off"
                },
                {
                  "name": "pca",
                  "type": "boolean",
                  "doc": "Whether an initial PCA step should be performed"
                },
                {
                  "name": "max_iter",
                  "type": "int",
                  "doc": "Maximum number of iterations"
                }
              ]
            }
          },
          {
            "name": "sql",
            "type": "string",
            "doc": "SQL query"
          },
          {
            "name": "count",
            "type": "int",
            "doc": "Number of records selected by the query"
          }
        ]
      },
      "init": {
        "variables": [
          "age"
        ],
        "covariables": [
          "left_amygdala",
          "left_splsupparlob",
          "right_poparoper",
          "right_pogpostcgyr"
        ],
        "grouping": [
          "prov"
        ],
        "parameters": {
          "dims": 2,
          "initial_dims": 50,
          "perplexity": 1,
          "theta": 0.5,
          "pca": true,
          "max_iter": 1000
        },
        "sql": "select * from brain",
        "count": 9
      }
    },
    "reduced_data": {
      "type": {
        "doc": "New representation for the data, with the covariables projected to N dimensions, where N is the dims parameter\nand groupings added for visualisation and further processing\n",
        "type": "array",
        "items": "ReducedData"
      },
      "init": [
        {
          "1": -17.11878893,
          "2": -102.96461404,
          "prov": "AD1",
          "age": 81.2
        },
        {
          "1": 288.97005935,
          "2": 198.74859944,
          "prov": "AD1",
          "age": 81.2
        },
        {
          "1": -24.82965194,
          "2": -84.44473342,
          "prov": "AD1",
          "age": 81.2
        },
        {
          "1": -36.26630739,
          "2": -56.97799786,
          "prov": "AD1",
          "age": 73.6
        },
        {
          "1": 306.68069692,
          "2": 243.7006467,
          "prov": "AD1",
          "age": 73.6
        },
        {
          "1": 299.5901311,
          "2": 225.99492791,
          "prov": "AD1",
          "age": 73.6
        },
        {
          "1": -5.52277366,
          "2": -130.82548993,
          "prov": "AD1",
          "age": 73.6
        },
        {
          "1": -405.99128461,
          "2": -137.37420226,
          "prov": "AD2",
          "age": 70.1
        },
        {
          "1": -405.51208084,
          "2": -155.85713656,
          "prov": "AD2",
          "age": 70.1
        }
      ]
    }
  },
  "action": [
    {
      "cell": "reduced_data"
    }
  ]
}

@ludovicc
Copy link
Author

"items": "ReducedData" ... that looks too simple! Many thanks for spotting this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment