Example #1
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'div',
            'argument_name': 'Language:',
            'argument_id': 'result',
        },
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'recognize'},
                               {'button_name': 'clear' }]
        }]
    properties = { 'title' : 'Language Detection',
                   'template': {'type': 'text',
                                'caption': 'Enter a sentence to classify:',
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                       {
                           'panel_name': 'arguments',
                           'panel_label': 'Dashboard',
                           'panel_property': arguments,
                       },
                       {
                           'panel_name': 'about',
                           'panel_label': 'About',
                           'panel_property': 'Developed by <a target="_blank" href="https://github.com/van51">van51</a>',
                        }
                    ]
                 }
    return render_to_response("application/language_detect.html",
                              properties,
                              context_instance = RequestContext(request))
Example #2
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_name': 'kernel',
            'argument_items': ['GaussianKernel', 'PolynomialKernel', 'LinearKernel'],
            'argument_default': 'GaussianKernel',
            'argument_explain': 'Your choice for the covariance function'
        },
        {
            'argument_type': 'integer',
            'argument_name': 'degree',
            'argument_default': '5',
            'argument_explain': 'The degree to use with the PolynomialKernel'
        },
        {
            'argument_type': 'decimal',
            'argument_label': 'Kernel Width',
            'argument_name': 'sigma',
            'argument_default': '2.0',
            'argument_explain': 'The sigma to use in the GaussianKernel'
        },
        {
            'argument_type': 'decimal',
            'argument_label': 'Noise Level',
            'argument_name': 'noise_level',
            'argument_default': '0.1',
            'argument_explain': 'The noise level of the training points'
        },
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'TrainGP',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'UseML2',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'clear'}]
        }
    ]
    properties = { 'title': 'Gaussian Process Regression',
                   'template': {'type': 'coordinate-2dims',
                                'mouse_click_enabled': 'left',
                                'coordinate_system': {'horizontal_axis': {'range': [-5, 5]},
                                                      'vertical_axis': {'range': [-5, 5]}},
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                       {
                           'panel_name': 'arguments',
                           'panel_label': 'Arguments',
                           'panel_property': arguments
                       },
                       {
                           'panel_name': 'toy_data',
                           'panel_label': 'Toy Data'
                       }]}
    return render_to_response("regression/gaussian_process.html",
                              properties, context_instance = RequestContext(request))
Example #3
0
def entrance(request):
    properties = { 'title' : 'Digit Recognize',
                   'template': {'type': 'drawing',
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                       {
                           'panel_name': 'preview',
                           'panel_label': 'Preview'}]}
    return render_to_response("application/ocr.html",
                              properties,
                              context_instance = RequestContext(request))
Example #4
0
def entrance(request):
    arguments = [
        {
            "argument_type": "select",
            "argument_name": "kernel",
            "argument_items": ["GaussianKernel", "PolynomialKernel", "LinearKernel"],
            "argument_default": "GaussianKernel",
            "argument_explain": "Your choice for the covariance function",
        },
        {
            "argument_type": "integer",
            "argument_name": "degree",
            "argument_default": "5",
            "argument_explain": "The degree to use with the PolynomialKernel",
        },
        {
            "argument_type": "decimal",
            "argument_label": "Kernel Width",
            "argument_name": "sigma",
            "argument_default": "2.0",
            "argument_explain": "The sigma to use in the GaussianKernel",
        },
        {
            "argument_type": "decimal",
            "argument_label": "Noise Level",
            "argument_name": "noise_level",
            "argument_default": "0.1",
            "argument_explain": "The noise level of the training points",
        },
        {
            "argument_type": "button-group",
            "argument_items": [
                {"button_name": "TrainGP", "button_type": "json_up_down_load"},
                {"button_name": "clear"},
            ],
        },
    ]
    properties = {
        "title": "Gaussian Process Regression",
        "template": {
            "type": "coordinate-2dims",
            "mouse_click_enabled": "left",
            "coordinate_system": {"horizontal_axis": {"range": [-5, 5]}, "vertical_axis": {"range": [-5, 5]}},
            "description": read_demo_description.read_description(__file__),
        },
        "panels": [
            {"panel_name": "arguments", "panel_label": "Arguments", "panel_property": arguments},
            {"panel_name": "toy_data", "panel_label": "Toy Data"},
        ],
    }
    return render_to_response("regression/gaussian_process.html", properties, context_instance=RequestContext(request))
Example #5
0
def entrance(request):
    properties = {
        'title': 'Digit Recognize',
        'template': {
            'type': 'drawing',
            'description': read_demo_description.read_description(__file__)
        },
        'panels': [{
            'panel_name': 'preview',
            'panel_label': 'Preview'
        }]
    }
    return render_to_response("application/ocr.html",
                              properties,
                              context_instance=RequestContext(request))
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_label': 'Kernel Function',
            'argument_name': 'kernel',
            'argument_items': ['GaussianKernel', 'PolynomialKernel', 'LinearKernel'],
            'argument_default': 'GaussianKernel',
            'argument_explain': 'Kernel Function'},
        {
            'argument_type': 'decimal',
            'argument_label': 'Kernel Width',
            'argument_name': 'kernel_width',
            'argument_default': '0.3',
            'argument_explain': 'The sigma to use in the GaussianKernel'},
        {
            'argument_type': 'integer',
            'argument_name': 'degree',
            'argument_default': '5',
            'argument_explain': 'The degree of the PolynomialKernel'},
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'generate',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'clear'}]},
        ]
    properties = { 'title': 'Kernel Matrix Visualization',
                   'template': {'type': 'coordinate-2dims',
                                'mouse_click_enabled': 'left',
                                'heatmap': { 'contour': True },
                                'coordinate_system': {'horizontal_axis': {'range':[-5.0, 5.0]},
                                                      'vertical_axis': {'range':[-4.0, 4.0]}},
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                        {
                            'panel_name': 'arguments',
                            'panel_label': 'Arguments',
                            'panel_property': arguments
                        },
                        {
                            'panel_name': 'toy_data',
                            'panel_label': 'Toy Data'
                        }]}
    return render_to_response("misc/kernel_matrix.html",
                              properties,
                              context_instance = RequestContext(request))
Example #7
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_label': 'Kernel Function',
            'argument_name': 'kernel',
            'argument_items': ['GaussianKernel', 'PolynomialKernel', 'LinearKernel'],
            'argument_default': 'GaussianKernel',
            'argument_explain': 'Kernel Function'},
        {
            'argument_type': 'decimal',
            'argument_label': 'Kernel Width',
            'argument_name': 'kernel_width',
            'argument_default': '0.3',
            'argument_explain': 'The sigma to use in the GaussianKernel'},
        {
            'argument_type': 'integer',
            'argument_name': 'degree',
            'argument_default': '5',
            'argument_explain': 'The degree of the PolynomialKernel'},
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'generate',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'clear'}]},
        ]
    properties = { 'title': 'Kernel Matrix Visualization',
                   'template': {'type': 'coordinate-2dims',
                                'mouse_click_enabled': 'left',
                                'heatmap': { 'contour': True },
                                'coordinate_system': {'horizontal_axis': {'range':[-5.0, 5.0]},
                                                      'vertical_axis': {'range':[-4.0, 4.0]}},
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                        {
                            'panel_name': 'arguments',
                            'panel_label': 'Arguments',
                            'panel_property': arguments
                        },
                        {
                            'panel_name': 'toy_data',
                            'panel_label': 'Toy Data'
                        }]}
    return render_to_response("misc/kernel_matrix.html",
                              properties,
                              context_instance = RequestContext(request))
Example #8
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_name': 'demo_switch',
            'argument_label': 'Feature Type',
            'argument_items': ['MIT_CBCL_faces_embedding',
                               'words_embedding',
                               'MNIST_digits_embedding',
                               'promoters_embedding',
                               'faces_embedding'],
            },
        {
            'argument_type': 'decimal',
            'argument_name': 'k',
            'argument_label': 'k',
            'argument_default': '20',
            'argument_explain': 'Number of neighbors to consider'
            },
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'show'},
                               {'button_name': 'clear'}],
            }
        ]
    properties = {'title': 'Dimension Reduction',
                  'template': {'type': 'coordinate-2dims',
                               'mouse_click_enabled': 'none',
                               'description': read_demo_description.read_description(__file__)},
                  'panels':[
                      {
                          'panel_name': 'arguments',
                          'panel_label': 'Arguments',
                          'panel_property': arguments
                      }]}
                
    return render_to_response("dimred/tapkee.html",
                              properties,
                              context_instance = RequestContext(request))
Example #9
0
            'x_range': [0, 1],
            'y_range': [0, 1]
        }]

properties = { 'title': 'KMeans',
               'template': {'type': 'coordinate-2dims',
                            'feature': 'binary',
                            'coordinate_range': {'horizontal': [0, 1],
                                                 'vertical': [0, 0.8]},
                            'coordinate_system': {'horizontal_axis': {'position': 'bottom',
                                                                      'label': 'X-axis',
                                                                      'range': [0, 1]},
                                                  'vertical_axis': {'position': 'left',
                                                                    'label': 'Y-axis',
                                                                    'range': [0, 1]}},
                            'description': read_demo_description.read_description(__file__),
                            'mouse_click_enabled': 'both'},
                'panels': [
                    {
                        'panel_name': 'arguments',
                        'panel_label': 'Arguments',
                        'panel_property': arguments
                    },
                    {
                        'panel_name': 'toy_data',
                        'panel_label': 'Toy Data',
                        'panel_property': toy_data_arguments}],
                   'data_sets' : ['diabetes']}

def entrance(request):
    return render_to_response("clustering/kmeans.html", properties, context_instance=RequestContext(request))
Example #10
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_name': 'kernel',
            'argument_items': ['GaussianKernel', 'PolynomialKernel', 'LinearKernel' ],
            'argument_default': 'GaussianKernel',
            'argument_explain': '<i>Kernel</i> Function',
        },
        {
            'argument_type': 'decimal',
            'argument_name': 'C',
            'argument_default': '1.2',
            'argument_explain': 'Penalty parameter of the error term'
        },
        {
            'argument_type': 'decimal',
            'argument_name': 'tube',
            'argument_default': '0.04',
            'argument_explain': 'Specifies the allowed deviation of the prediction from the actual value'
        },
        {
            'argument_type': 'decimal',
            'argument_name': 'sigma',
            'argument_default': '0.3',
            'argument_explain': 'The sigma to use in the GaussianKernel'
        },
        {
            'argument_type': 'integer',
            'argument_name': 'degree',
            'argument_default': '5',
            'argument_explain': 'The degree to use in the PolynomialKernel'
        },
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'regress',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'clear'}]
        }
        ]
    toy_data_arguments = [
        {
            'problem_type': 'regression',
            }
        ]
        
    properties = { 'title': 'Supported Vector Regression',
                   'template': {'type': 'coordinate-2dims',
                                'heatmap': False,
                                'coordinate_system': {'horizontal_axis': {'position': 'bottom',
                                                                          'label': 'x-axis',
                                                                          'range': [0, 1]},
                                                      'vertical_axis': {'position': 'left',
                                                                        'label': 'y-axis',
                                                                        'range': [0, 1]}},
                                'mouse_click_enabled': 'left',
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                       {
                           'panel_name': 'arguments',
                           'panel_label': 'Arguments',
                           'panel_property': arguments
                       },
                       {
                           'panel_name': 'toy_data',
                           'panel_label': 'toy data',
                           'panel_property': toy_data_arguments
                       }]}
    return render_to_response("regression/support_vector_regression.html",
                              properties,
                              context_instance=RequestContext(request))
Example #11
0
def entrance(request):
    arguments = [{
        'argument_type':
        'select',
        'argument_label':
        'Regression',
        'argument_name':
        'regression',
        'argument_items': [
            'LeastSquaresRegression', 'LinearRidgeRegression',
            'KernelRidgeRegression'
        ],
        'argument_explain':
        'Regression tool'
    }, {
        'argument_type':
        'decimal',
        'argument_name':
        'sigma',
        'argument_default':
        '0.3',
        'argument_explain':
        'For GaussianKernel (KernelRidgeRegression)'
    }, {
        'argument_type':
        'decimal',
        'argument_name':
        'Tau',
        'argument_default':
        '5',
        'argument_explain':
        'tau to use in the (Kernel)RidgeRegression'
    }, {
        'argument_type':
        'button-group',
        'argument_items': [{
            'button_name': 'regress',
            'button_type': 'json_up_down_load'
        }, {
            'button_name': 'clear'
        }]
    }]

    toy_data_arguments = [{
        'problem_type': 'regression',
    }]

    properties = {
        'title':
        'Regression',
        'template': {
            'type': 'coordinate-2dims',
            'heatmap': False,
            'coordinate_system': {
                'horizontal_axis': {
                    'position': 'bottom',
                    'label': 'x-axis',
                    'range': [0, 1]
                },
                'vertical_axis': {
                    'position': 'left',
                    'label': 'y-axis',
                    'range': [0, 1]
                }
            },
            'mouse_click_enabled': 'left',
            'description': read_demo_description.read_description(__file__)
        },
        'panels': [{
            'panel_name': 'arguments',
            'panel_label': 'Arguments',
            'panel_property': arguments
        }, {
            'panel_name': 'toy_data',
            'panel_label': 'toy data',
            'panel_property': toy_data_arguments
        }],
        'data_sets': ['boston_housing']
    }
    return render_to_response("regression/regression.html",
                              properties,
                              context_instance=RequestContext(request))
Example #12
0
def entrance(request):
    arguments = [{
        'argument_type':
        'select',
        'argument_name':
        'kernel',
        'argument_items':
        ['GaussianKernel', 'PolynomialKernel', 'LinearKernel'],
        'argument_default':
        'GaussianKernel',
        'argument_explain':
        'Your choice for the covariance function'
    }, {
        'argument_type':
        'select',
        'argument_label':
        'Inference Method',
        'argument_name':
        'inf',
        'argument_items': ['ExactInferenceMethod', 'FITCInferenceMethod'],
        'argument_default':
        'ExactInferenceMethod',
        'argument_explain':
        'Your choice for the Inference method'
    }, {
        'argument_type':
        'integer',
        'argument_name':
        'degree',
        'argument_default':
        '5',
        'argument_explain':
        'The degree to use with the PolynomialKernel'
    }, {
        'argument_type': 'decimal',
        'argument_label': 'Kernel Width',
        'argument_name': 'sigma',
        'argument_default': '1.0',
        'argument_explain': 'The sigma to use in the GaussianKernel'
    }, {
        'argument_type': 'decimal',
        'argument_label': 'Noise Level',
        'argument_name': 'noise_level',
        'argument_default': '0.1',
        'argument_explain': 'The noise level of the training points'
    }, {
        'argument_type': 'decimal',
        'argument_name': 'scale',
        'argument_label': 'Kernel scaling',
        'argument_default': '1.0',
        'argument_explain': 'The scale for kernel'
    }, {
        'argument_type': 'select',
        'argument_label': 'Learn parameters',
        'argument_name': 'learn',
        'argument_items': ['No', 'ML2'],
        'argument_explain': 'Learn parameters using model selection'
    }, {
        'argument_type':
        'button-group',
        'argument_items': [{
            'button_name': 'TrainGP',
            'button_type': 'json_up_down_load'
        }, {
            'button_name': 'plot_predictive',
            'button_type': 'json_up_down_load'
        }, {
            'button_name': 'clear'
        }]
    }]
    toy_data_arguments = [{
        'problem_type': 'regression',
    }]

    properties = {
        'title':
        'Gaussian Process Regression',
        'template': {
            'type': 'coordinate-2dims',
            'mouse_click_enabled': 'both',
            'coordinate_system': {
                'horizontal_axis': {
                    'range': [-5, 5]
                },
                'vertical_axis': {
                    'range': [-5, 5]
                }
            },
            'heatmap': {
                'contour': True
            },
            'description': read_demo_description.read_description(__file__)
        },
        'panels': [{
            'panel_name': 'arguments',
            'panel_label': 'Arguments',
            'panel_property': arguments
        }, {
            'panel_name': 'toy_data',
            'panel_label': 'Toy Data',
            'panel_property': toy_data_arguments
        }]
    }
    return render_to_response("regression/gaussian_process.html",
                              properties,
                              context_instance=RequestContext(request))
Example #13
0
def description_by_url(url):
    return read_demo_description.read_description(DEMOS_PATH + url[:-1] + ".py")
Example #14
0
def description_by_url(url):
    return read_demo_description.read_description(DEMOS_PATH + url[:-1] +
                                                  ".py")
Example #15
0
def entrance(request):
    arguments = [
        {
            'argument_type': 'select',
            'argument_label': 'Regression',
            'argument_name': 'regression',
            'argument_items': ['LeastSquaresRegression',
                               'LinearRidgeRegression',
                               'KernelRidgeRegression'],
            'argument_explain': 'Regression tool'
        },
        {
            'argument_type': 'decimal',
            'argument_name': 'sigma',
            'argument_default': '0.3',
            'argument_explain': 'For GaussianKernel (KernelRidgeRegression)'
        },
        {
            'argument_type': 'decimal',
            'argument_name': 'Tau',
            'argument_default': '5',
            'argument_explain': 'tau to use in the (Kernel)RidgeRegression'
        },
        {
            'argument_type': 'button-group',
            'argument_items': [{'button_name': 'regress',
                                'button_type': 'json_up_down_load'},
                               {'button_name': 'clear'}]
        }]

    toy_data_arguments = [
        {
            'problem_type': 'regression',
            }
        ]

        
    properties = { 'title': 'Regression',
                   'template': {'type': 'coordinate-2dims',
                                'heatmap': False,
                                'coordinate_system': {'horizontal_axis': {'position': 'bottom',
                                                                          'label': 'x-axis',
                                                                          'range': [0, 1]},
                                                      'vertical_axis': {'position': 'left',
                                                                        'label': 'y-axis',
                                                                        'range': [0, 1]}},
                                'mouse_click_enabled': 'left',
                                'description': read_demo_description.read_description(__file__)},
                   'panels': [
                       {
                           'panel_name': 'arguments',
                           'panel_label': 'Arguments',
                           'panel_property': arguments
                       },
                       {
                           'panel_name': 'toy_data',
                           'panel_label': 'toy data',
                           'panel_property': toy_data_arguments
                       }],
                    'data_sets' : ['boston_housing']
                       }
    return render_to_response("regression/regression.html",
                              properties,
                              context_instance=RequestContext(request))