Skip to content

Commit

Permalink
Merge pull request #51 from SOCR/dev
Browse files Browse the repository at this point in the history
Release v0.1.5-alpha.2
#SOCRFW-200
  • Loading branch information
alxndrkalinin committed Dec 2, 2015
2 parents 20b9c26 + a5e42a3 commit 7ecf508
Show file tree
Hide file tree
Showing 17 changed files with 786 additions and 37 deletions.
34 changes: 28 additions & 6 deletions app/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ App = angular.module('app', [
# 'app_analysis_qualRobEstView'
# 'app_analysis_qualRobEst'
'app_analysis_instrPerfEval'
'app_analysis_kMeans'
])

App.config([
Expand Down Expand Up @@ -100,15 +101,22 @@ App.config([
'sidebar':
templateUrl: 'partials/analysis/wrangleData/sidebar.html'
)
.state('tools'
url: '/tools'
.state('instrperfeval'
url: '/tools/instrperfeval'
views:
'main':
templateUrl: 'partials/analysis/tools/instrPerfEval/main.html'
templateUrl: 'partials/analysis/tools/psychometrics/instrPerfEval/main.html'
'sidebar':
templateUrl: 'partials/analysis/tools/instrPerfEval/sidebar.html'
templateUrl: 'partials/analysis/tools/psychometrics/instrPerfEval/sidebar.html'
)
.state('kmeans'
url: '/tools/kmeans'
views:
'main':
templateUrl: 'partials/analysis/tools/machineLearning/kMeans/main.html'
'sidebar':
templateUrl: 'partials/analysis/tools/machineLearning/kMeans/sidebar.html'
)

.state('charts'
url: '/charts/:projectId/:forkId'
views:
Expand All @@ -131,10 +139,11 @@ App.run([
# 'app_analysis_qualRobEst_constructor'
# 'app_analysis_qualRobEstView_constructor'
'app_analysis_instrPerfEval_constructor'
'app_analysis_kMeans_constructor'
'app_analysis_charts_constructor'
#'app.utils.importer'
# ($rootScope, core, db, getData, wrangleData, qualRobEst, qualRobEstView, instrPerfEval) ->
($rootScope, core, db, getData, wrangleData, instrPerfEval) ->
($rootScope, core, db, getData, wrangleData, instrPerfEval, kMeans) ->

map = [
# msgFrom: 'add numbers'
Expand Down Expand Up @@ -172,6 +181,16 @@ App.run([
scopeFrom: ['database']
msgTo: 'take table'
scopeTo: ['instrPerfEval']
,
msgFrom: 'get data'
scopeFrom: ['kMeans']
msgTo: 'get table'
scopeTo: ['database']
,
msgFrom: 'take table'
scopeFrom: ['database']
msgTo: 'take data'
scopeTo: ['kMeans']
,
msgFrom: 'get data'
scopeFrom: ['wrangleData']
Expand Down Expand Up @@ -214,6 +233,9 @@ App.run([
core.register 'instrPerfEval', instrPerfEval
core.start 'instrPerfEval'

core.register 'kMeans', kMeans
core.start 'kMeans'

#core.register 'importer', importer
#core.start 'importer'

Expand Down
1 change: 1 addition & 0 deletions app/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ html(lang='en', ng-app='app')
script(src='bower_components/bootstrap/dist/js/bootstrap.js')
script(src='bower_components/angular-bootstrap/ui-bootstrap-tpls.js')
script(src='bower_components/jstat/dist/jstat.js')
script(src='bower_components/jsfeat/build/jsfeat.js')
// endbower
body(ng-controller='AppCtrl')
.container-fluid
Expand Down
13 changes: 10 additions & 3 deletions app/partials/analysis-nav.jade
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
//main navigation template
// main navigation template
ul.nav.navbar-nav
li(ng-class="getClass('/getData')")
a(ng-href='#/getData') Raw Data
li(ng-class="getClass('/wrangleData')")
a(ng-href='#/wrangleData') Wrangle Data
li(ng-class="getClass('/tools')")
a(ng-href='#/tools') Tools
li.dropdown
a(href="#", data-toggle="dropdown", role="button", aria-haspopup="true", aria-expanded="false").dropdown-toggle
| Tools
span.caret
ul.dropdown-menu
li(ng-class="getClass('/tools/instrperfeval')")
a(ng-href='#/tools/instrperfeval') Instrument Performance Evaluation
li(ng-class="getClass('/tools/kmeans')")
a(ng-href='#/tools/kmeans') 2D k-Means Clustering
li(ng-class="getClass('/charts')")
a(ng-href='#/charts') Charts
li(ng-class="getClass('/results')")
Expand Down
7 changes: 7 additions & 0 deletions app/partials/analysis/getData/main.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ div(ng-controller='getDataMainCtrl')
p.lead To perform any analysis, you need data to begin with. Choose one of the available methods
|to get the data into the web-app.

form.socrData(collapse="showState.socrData")
legend SOCR Datasets
div.form-group
select(ng-model="socrdataset",\
ng-options="item as item.name for item in socrDatasets track by item.id").form-control
button.btn.btn-medium(ng-click="getSocrData()") Load

div.worldBank(collapse="showState.worldBank")
h3 WorldBank Data
span Size:
Expand Down
5 changes: 4 additions & 1 deletion app/partials/analysis/getData/sidebar.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ div(ng-controller="getDataSidebarCtrl")
span Traditional spreadsheet where you can copy-paste your data and edit it as you like!
button.btn.btn-info.btn-sm(ng-click="show('grid')") Show
hr
span Use one of the predefined SOCR datasets.
button.btn.btn-info.btn-sm(ng-click="show('socrData')") Use
hr
span Use the exhaustive WorldBank data to fuel your analysis.
button.btn.btn-info.btn-sm(ng-click="show('worldBank')") Use
hr
span Use the inbuilt experiment to generate data for your analysis.
button.btn.btn-info.btn-sm(ng-click="show('generate')") Generate
hr
span Enter json url here. We will try to give the best output!
span Enter JSON URL here to parse
input(ng-model="jsonUrl",type="text",
tooltip="Enter url here...",tooltip-trigger="focus",
tooltip-placement="right").input-medium
Expand Down
16 changes: 16 additions & 0 deletions app/partials/analysis/tools/machineLearning/kMeans/main.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
div(ng-controller="kMeansMainCtrl")
h2 2D k-means Clustering
p.
k-means clustering aims to partition n observations into k clusters in which each observation belongs
to the cluster with the nearest mean, serving as a prototype of the cluster.
div(ng-show="showresults").kmeans-results
p.lead <strong> Average accuracy: </strong> {{avgAccuracy}}
div.table-responsive
table.table.table-bordered.table-condensed
tr
th Label
th Accuracy
tr(ng-repeat="(label, acc) in accs")
td {{label}}
td {{acc.toFixed(2)}}
app-kmeans
31 changes: 31 additions & 0 deletions app/partials/analysis/tools/machineLearning/kMeans/sidebar.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
div(ng-controller="kMeansSidebarCtrl")
form
legend Parameters
div.form-group
label X column &nbsp;
//- show data header column names
select(ng-model="xCol", ng-options="col for col in cols").form-control
div.form-group
label Y column &nbsp;
//- show data header column names
select(ng-model="yCol", ng-options="col for col in cols").form-control
div.checkbox
label
input(type="checkbox", ng-model="labelson")
| Use labels column
div.form-group
fieldset(ng-disabled="!labelson")
label Labels column &nbsp;
//- show data header column names
select(ng-model="labelCol", ng-options="col for col in cols").form-control
div.form-group
label k &nbsp;
select(ng-model="k", ng-options="k for k in ks").form-control
div.form-group
label Distance &nbsp;
select(ng-model="dist", ng-options="dist for dist in distances").form-control
div.form-group
label Initialization &nbsp;
select(ng-model="initMethod", ng-options="init for init in inits").form-control
button(type="submit", aria-label="Run k-Means", ng-click="run()", ng-disabled="kmeanson").btn.btn-primary Run&nbsp;
span.glyphicon.glyphicon-refresh(aria-hidden="true", ng-class="running")
Loading

0 comments on commit 7ecf508

Please sign in to comment.