Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
82ab896
Initialize branch
YunkeXiao May 21, 2019
296b31c
Fixed module imports
YunkeXiao May 21, 2019
b6ccaad
black formatter applied
YunkeXiao May 21, 2019
6f3aa09
Updated Procfile
YunkeXiao May 21, 2019
ee60a08
Merge branch 'master' into dash-svm
YunkeXiao May 23, 2019
170cf42
Merge branch 'master' into dash-svm
YunkeXiao May 23, 2019
4ecd1ff
Fixed README and updated reuiqrements.txt
YunkeXiao May 28, 2019
0e4922e
Fixed README
YunkeXiao May 28, 2019
93a49c6
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao May 28, 2019
ddb6ea3
Added mobile layout
YunkeXiao May 28, 2019
1d702e3
Added mobile layout
YunkeXiao May 28, 2019
75c88e4
Black format
YunkeXiao May 28, 2019
6def094
Merge branch 'master' into dash-svm
May 30, 2019
8ea7229
Force circle_ci
YunkeXiao May 30, 2019
af9cc1c
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao May 30, 2019
f383988
fixed readme
YunkeXiao May 30, 2019
20c056d
Added meta tags
YunkeXiao May 30, 2019
e40a3b4
fixed meta tag
YunkeXiao May 30, 2019
1f9ae8f
black format
YunkeXiao May 30, 2019
e4bd295
Merge branch 'master' into dash-svm
YunkeXiao May 30, 2019
e281853
test
YunkeXiao May 30, 2019
ebf86ba
Added mobile layout
YunkeXiao May 30, 2019
3ff6edc
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao May 30, 2019
53048a1
Fixed a few margins and paddings
YunkeXiao Jun 4, 2019
731486f
Fixed figure colorscale
YunkeXiao Jun 4, 2019
50eb71a
Fix css conflicts
YunkeXiao Jun 4, 2019
ae2fe08
Merge branch 'master' into dash-svm
YunkeXiao Jun 4, 2019
7780e1b
Fixed mobile layout space between graphs
YunkeXiao Jun 4, 2019
7bc108e
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jun 4, 2019
5ee2a71
test playground
YunkeXiao Jun 4, 2019
e699b17
Merge branch 'master' into dash-svm
YunkeXiao Jun 4, 2019
08a1734
added meta tags
YunkeXiao Jun 4, 2019
264cbf0
black format
YunkeXiao Jun 4, 2019
22d8dd7
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jun 4, 2019
278009a
Merge branch 'master' into dash-svm
YunkeXiao Jun 4, 2019
debe6d9
Merge branch 'master' into dash-svm
YunkeXiao Jun 5, 2019
224b3b7
Merge branch 'master' into dash-svm
YunkeXiao Jun 7, 2019
7e11aeb
Merge branch 'master' into dash-svm
YunkeXiao Jun 28, 2019
b3b15a5
Merge branch 'master' into dash-svm
YunkeXiao Jul 2, 2019
8c08ca5
Merge branch 'master' into dash-svm
YunkeXiao Jul 6, 2019
bb9c375
Merge branch 'master' into dash-svm
YunkeXiao Jul 9, 2019
c9eaa1b
Fix mobile layout height issue
YunkeXiao Jul 9, 2019
0c2e321
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 9, 2019
8959526
Update requirements.txt and remove unecessary !important tags
YunkeXiao Jul 9, 2019
6a8bedc
Merge branch 'master' into dash-svm
YunkeXiao Jul 9, 2019
bc20954
Merge branch 'master' into dash-svm
YunkeXiao Jul 10, 2019
1a40311
Clean css code a little
YunkeXiao Jul 10, 2019
525d39b
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 10, 2019
a07b94d
Merge branch 'master' into dash-svm
YunkeXiao Jul 14, 2019
c1fafe2
Fix layout for displays above 1300px width
YunkeXiao Jul 15, 2019
f96a992
Fix layout for displays above 950px width
YunkeXiao Jul 15, 2019
6975401
Fix layout for displays above 650px width
YunkeXiao Jul 15, 2019
bd94735
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 15, 2019
a5480d6
Fix layout for displays above 350px width
YunkeXiao Jul 15, 2019
bfb6bb4
black format
YunkeXiao Jul 16, 2019
9925e23
Force run tests
YunkeXiao Jul 16, 2019
1a7ee63
Reorganize
YunkeXiao Jul 16, 2019
747e946
Fix mobile layout of top-row graphs
YunkeXiao Jul 17, 2019
fd15327
Merge branch 'dash-svm' of https://github.com/plotly/dash-sample-apps…
YunkeXiao Jul 17, 2019
536578c
Replace wrong css file
YunkeXiao Jul 17, 2019
6d99a05
Merge branch 'master' into dash-svm
YunkeXiao Jul 18, 2019
02f363a
Remove dash-stitching code and add placeholder graph when loading
YunkeXiao Jul 18, 2019
d8e4e0b
Shrink logo size
YunkeXiao Jul 18, 2019
936ae44
Shrink font size in mobile layout
YunkeXiao Jul 18, 2019
9049eec
Merge branch 'master' into dash-svm
YunkeXiao Jul 18, 2019
4b70080
Wrapp dcc.Loading around graphs and adjust CSS accordingly
YunkeXiao Jul 19, 2019
8904077
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 19, 2019
eab985d
Remove display:none styling on loading components
YunkeXiao Jul 19, 2019
d642585
Merge branch 'master' into dash-svm
YunkeXiao Jul 19, 2019
590ca49
Add more headers to css
YunkeXiao Jul 19, 2019
c40211b
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 19, 2019
9ea3169
Merge branch 'master' into dash-svm
YunkeXiao Jul 23, 2019
30d6988
Remove css body header
YunkeXiao Jul 23, 2019
95d2b69
Merge remote-tracking branch 'origin/dash-svm' into dash-svm
YunkeXiao Jul 23, 2019
aec405e
Correct colors on Card components and graphs
YunkeXiao Jul 23, 2019
af91bf3
Merge branch 'master' into dash-svm
YunkeXiao Jul 24, 2019
9db2803
Merge branch 'master' into dash-svm
YunkeXiao Jul 25, 2019
5cae788
Merge branch 'master' into dash-svm
YunkeXiao Jul 25, 2019
3fecb91
Merge branch 'master' into dash-svm
YunkeXiao Jul 29, 2019
db5d2db
Merge branch 'master' into dash-svm
YunkeXiao Jul 29, 2019
25c9728
Merge branch 'master' into dash-svm
YunkeXiao Jul 29, 2019
9680cce
Remove unecessary padding on .card class and fix dash_reusable_compon…
YunkeXiao Jul 29, 2019
2b88a9d
Merge branch 'master' into dash-svm
YunkeXiao Jul 30, 2019
2741d48
Merge branch 'master' into dash-svm
Jul 30, 2019
4c4fcb2
Update README with new screenshot, fixed paths and removed unecessary…
YunkeXiao Jul 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/dash-svm/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn --pythonpath apps/dash-svm app:server
73 changes: 73 additions & 0 deletions apps/dash-svm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Support Vector Machine (SVM) Explorer [![Mentioned in Awesome Machine Learning](https://awesome.re/mentioned-badge.svg)](https://github.com/josephmisiti/awesome-machine-learning)

This is a learning tool and exploration app made using the Dash interactive Python framework developed by [Plotly](https://plot.ly/).

Dash abstracts away all of the technologies and protocols required to build an interactive web-based application and is a simple and effective way to bind a user interface around your Python code. To learn more check out our [documentation](https://plot.ly/dash).

Try out the [demo app here](https://dash-svm.plot.ly/).

![alt text](images/screenshot.png "Screenshot")


## Getting Started
### Using the demo
This demo lets you interactive explore Support Vector Machine (SVM).

It includes a few artificially generated datasets that you can choose from the dropdown, and that you can modify by changing the sample size and the noise level of those datasets.

The other dropdowns and sliders lets you change the parameters of your classifier, such that it could increase or decrease its accuracy.

### Running the app locally

First create a virtual environment with conda or venv inside a temp folder, then activate it.

```
virtualenv dash-svm-venv

# Windows
dash-svm-venv\Scripts\activate
# Or Linux
source venv/bin/activate
```

Clone the git repo, then install the requirements with pip
```
git clone https://github.com/plotly/dash-sample-apps/apps/dash-svm.git
cd dash-sample-apps/apps/dash-svm
pip install -r requirements.txt
```

Run the app
```
python app.py
```

## About the app
### How does it work?

This app is fully written in Dash + scikit-learn. All the components are used as input parameters for scikit-learn functions, which then generates a model with respect to the parameters you changed. The model is then used to perform predictions that are displayed on a contour plot, and its predictions are evaluated to create the ROC curve and confusion matrix.

In addition to creating models, scikit-learn is used to generate the datasets you see, as well as the data needed for the metrics plots.

### What is an SVM?
An SVM is a popular Machine Learning model used in many different fields. You can find an [excellent guide to how to use SVMs here](https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf).

## Built With
* [Dash](https://dash.plot.ly/) - Main server and interactive components
* [Plotly Python](https://plot.ly/python/) - Used to create the interactive plots
* [Scikit-Learn](http://scikit-learn.org/stable/documentation.html) - Run the classification algorithms and generate datasets


## Authors

* **Xing Han Lu** - *Initial Work* - [@xhlulu](https://github.com/xhlulu)
* **Matthew Chan** - *Code Review* - [@matthewchan15](https://github.com/matthewchan15)
* **Yunke Xiao** - *Redesign* - [@YunkXiao](https://github.com/YunkeXiao)
* **celinehuang** - *Code Review* - [@celinehuang](https://github.com/celinehuang)


## Acknowledgments
The heatmap configuration is heavily inspired from the [scikit-learn Classification Comparison Tutorial](http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html). Please go take a look!

The idea of the [ROC Curve, the Matrix Pie Chart and Thresholding](https://github.com/nicolaskruchten/dash-roc) came from @nickruchten. The app would not have been as complete without his insightful advice.

Loading