Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

# Setup

First, go to `lib/atm`, and install ATM as described in [here](https://github.com/HDI-Project/ATM)
First, run the follow commands to clone ATM as a submodule

```
git submodule init
git submodule update
```
Then, go to `lib/atm` and install ATM as described in [here](https://github.com/HDI-Project/ATM)

Then go to `server/` and run `pip install -r requirements.txt`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"react-scripts-ts": "2.16.0"
},
"scripts": {
"start": "PORT=7779 react-scripts-ts start",
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
Expand Down
1,001 changes: 1,001 additions & 0 deletions public/viz/dataset_31_credit-g.csv

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions public/viz/pollution_1_test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
,PREC,JANT,JULT,OVR65,POPN,EDUC,HOUS,DENS,NONW,WWDRK,POOR,HC,NOX,SO@,HUMID,purpose,class
0,36,27,71,8.1,3.34,11.4,81.5,3243,8.8,42.6,11.7,21,15,59,59,radio/tv,0
1,35,23,72,11.1,3.14,11,78.8,4281,3.5,50.7,14.4,8,10,39,57,radio/tv,1
2,44,29,74,10.4,3.21,9.8,81.6,4260,0.8,39.4,12.4,6,6,33,54,education,1
3,47,45,79,6.5,3.41,11.1,77.5,3125,27.1,50.2,20.6,18,8,24,56,furniture/equipment,1
4,43,35,77,7.6,3.44,9.6,84.6,6441,24.4,43.7,14.3,43,38,206,55,'new car',1
5,53,45,80,7.7,3.45,10.2,66.8,3325,38.5,43.1,25.5,30,32,72,54,education,1
6,43,30,74,10.9,3.23,12.1,83.9,4679,3.5,49.2,11.3,21,32,62,56,furniture/equipment,0
7,45,30,73,9.3,3.29,10.6,86,2140,5.3,40.4,10.5,6,4,4,56,'used car',0
8,36,24,70,9,3.31,10.5,83.2,6582,8.1,42.5,12.6,18,12,37,61,radio/tv,1
9,36,27,72,9.5,3.36,10.7,79.3,4213,6.7,41,13.2,12,7,20,59,'new car',0
10,52,42,79,7.7,3.39,9.6,69.2,2302,22.2,41.3,24.2,18,8,27,56,'new car',1
11,33,26,76,8.6,3.2,10.9,83.4,6122,16.3,44.9,10.7,88,63,278,58,business,1
12,40,34,77,9.2,3.21,10.2,77,4101,13,45.7,15.1,26,26,146,57,radio/tv,1
13,35,28,71,8.8,3.29,11.1,86.3,3042,14.7,44.6,11.4,31,21,64,60,'new car',1
14,37,31,75,8,3.26,11.9,78.4,4259,13.1,49.6,13.9,23,9,15,58,'new car',1
15,35,46,85,7.1,3.22,11.8,79.9,1441,14.8,51.2,16.1,1,1,1,54,radio/tv,0
16,36,30,75,7.5,3.35,11.4,81.9,4029,12.4,44,12,6,4,16,58,radio/tv,0
17,15,30,73,8.2,3.15,12.2,84.2,4824,4.7,53.1,12.7,17,8,28,38,business,0
18,31,27,74,7.2,3.44,10.8,87,4834,15.8,43.5,13.6,52,35,124,59,'used car',1
19,30,24,72,6.5,3.53,10.8,79.5,3694,13.1,33.8,12.4,11,4,11,61,radio/tv,1
20,31,45,85,7.3,3.22,11.4,80.7,1844,11.5,48.1,18.5,1,1,1,53,'new car',0
21,31,24,72,9,3.37,10.9,82.8,3226,5.1,45.2,12.3,5,3,10,61,radio/tv,0
22,42,40,77,6.1,3.45,10.4,71.8,2269,22.7,41.4,19.5,8,3,5,53,'new car',1
23,43,27,72,9,3.25,11.5,87.1,2909,7.2,51.6,9.5,7,3,10,56,'used car',0
24,46,55,84,5.6,3.35,11.4,79.7,2647,21,46.9,17.9,6,5,1,59,furniture/equipment,1
25,39,29,75,8.7,3.23,11.4,78.6,4412,15.6,46.6,13.2,13,7,33,60,furniture/equipment,1
26,35,31,81,9.2,3.1,12,78.3,3262,12.6,48.6,13.9,7,4,4,55,radio/tv,0
27,43,32,74,10.1,3.38,9.5,79.2,3214,2.9,43.7,12,11,7,32,54,radio/tv,0
28,11,53,68,9.2,2.99,12.1,90.6,4700,7.8,48.9,12.3,648,319,130,47,radio/tv,0
29,30,35,71,8.3,3.37,9.9,77.4,4474,13.1,42.6,17.7,38,37,193,57,business,1
30,50,42,82,7.3,3.49,10.4,72.5,3497,36.7,43.3,26.4,15,18,34,59,business,1
31,60,67,82,10,2.98,11.5,88.6,4657,13.5,47.3,22.4,3,1,1,60,furniture/equipment,0
32,30,20,69,8.8,3.26,11.1,85.4,2934,5.8,44,9.4,33,23,125,64,'new car',0
33,25,12,73,9.2,3.28,12.1,83.1,2095,2,51.9,9.8,20,11,26,58,business,0
34,45,40,80,8.3,3.32,10.1,70.3,2682,21,46.1,24.1,17,14,78,56,furniture/equipment,1
35,46,30,72,10.2,3.16,11.3,83.2,3327,8.8,45.3,12.2,4,3,8,58,radio/tv,0
36,54,54,81,7.4,3.36,9.7,72.8,3172,31.4,45.5,24.2,20,17,1,62,education,1
37,42,33,77,9.7,3.03,10.7,83.5,7462,11.3,48.7,12.4,41,26,108,58,radio/tv,1
38,42,32,76,9.1,3.32,10.5,87.5,6092,17.5,45.3,13.2,29,32,161,54,'domestic appliance',1
39,36,29,72,9.5,3.32,10.6,77.6,3437,8.1,45.5,13.8,45,59,263,56,radio/tv,1
40,37,38,67,11.3,2.99,12,81.5,3387,3.6,50.3,13.5,56,21,44,73,radio/tv,0
41,42,29,72,10.7,3.19,10.1,79.5,3508,2.2,38.8,15.7,6,4,18,56,radio/tv,0
42,41,33,77,11.2,3.08,9.6,79.9,4843,2.7,38.6,14.1,11,11,89,54,repairs,1
43,44,39,78,8.2,3.32,11,79.9,3768,28.6,49.5,17.5,12,9,48,53,'used car',1
44,32,25,72,10.9,3.21,11.1,82.5,4355,5,46.4,10.8,7,4,18,60,'used car',0
45,34,32,79,9.3,3.23,9.7,76.8,5160,17.2,45.1,15.3,31,15,68,57,'new car',1
46,10,55,70,7.3,3.11,12.1,88.9,3033,5.9,51,14,144,66,20,61,radio/tv,0
47,18,48,63,9.2,2.92,12.2,87.7,4253,13.7,51.2,12,311,171,86,71,'used car',0
48,13,49,68,7,3.36,12.2,90.7,2702,3,51.9,9.7,105,32,3,71,'new car',0
49,35,40,64,9.6,3.02,12.2,82.5,3626,5.7,54.3,10.1,20,7,20,72,radio/tv,0
50,45,28,74,10.6,3.21,11.1,82.6,1883,3.4,41.9,12.3,5,4,20,56,furniture/equipment,0
51,38,24,72,9.8,3.34,11.4,78,4923,3.8,50.5,11.1,8,5,25,61,'used car',1
52,31,26,73,9.3,3.22,10.7,81.3,3249,9.5,43.9,13.6,11,7,25,59,radio/tv,1
53,40,23,71,11.3,3.28,10.3,73.8,1671,2.5,47.4,13.5,5,2,11,60,'used car',0
54,41,37,78,6.2,3.25,12.3,89.5,5308,25.9,59.7,10.3,65,28,102,52,'new car',1
55,28,32,81,7,3.27,12.1,81,3665,7.5,51.6,13.2,4,2,1,54,'new car',0
56,45,33,76,7.7,3.39,11.3,82.2,3152,12.1,47.3,10.9,14,11,42,56,radio/tv,1
57,45,24,70,11.8,3.25,11.1,79.8,3678,1,44.8,14,7,3,8,56,radio/tv,0
58,42,33,76,9.7,3.22,9,76.2,9699,4.8,42.2,14.5,8,8,49,54,'new car',0
59,38,28,72,8.9,3.48,10.7,79.8,3451,11.7,37.5,13,14,13,39,58,furniture/equipment,1
13 changes: 10 additions & 3 deletions src/assets/methods.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
"mlp": {
"name": "mlp",
"class": "sklearn.neural_network.MLPClassifier",
"fullname": "multiple layer process",
"fullname": "multiple layer perceptron",
"hyperparameters": {
"batch_size": {
"type": "string",
Expand Down Expand Up @@ -476,8 +476,15 @@
"root_hyperparameters": ["batch_size", "solver", "alpha", "activation", "hidden_layer_sizes", "_scale"],
"conditional_hyperparameters": {
"solver": {
"sgd": ["learning_rate_init", "learning_rate"],
"adam": ["learning_rate_init", "beta_1", "beta_2"]
"sgd": [
"learning_rate_init",
"learning_rate"
],
"adam": [
"learning_rate_init",
"beta_1",
"beta_2"
]
}
}
},
Expand Down
9 changes: 7 additions & 2 deletions src/components/DataRuns/Methods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,18 @@ class Method extends React.Component<{method:IMethod, datarun:IDataRun}, {}>{
tooltip:{},
lineStyle: {
normal: {
width: 2,
width: 1,
opacity: 0.8,
color: getColor(method.name)
}
},
data,
}
},
// {
// name: 'bar',
// type: 'bar',
// data: [120, 200, 150, 80, 70, 110, 130]
// }
],

}
Expand Down
16 changes: 11 additions & 5 deletions src/components/DataView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface IState {
}
export interface IFeature{
name: string,
data: number[]
data: any[] // Revised number[] to any[]
}
// export interface IDataset{
// name:string,
Expand All @@ -30,9 +30,8 @@ export default class DataView extends React.Component<{}, IState>{
}
}
public async getData() {
const res = await axios.get('../../viz/pollution_1.csv') // this should be changed to the server response later
const datum = res.data

const res = await axios.get('../../viz/pollution_1_test.csv') // this should be changed to the server response later
const datum = res.data.trim() //trim to remove the last blank line
const lines = datum.split('\n')
const features = lines[0].split(',').map(
(feature:string)=>{
Expand All @@ -41,10 +40,16 @@ export default class DataView extends React.Component<{}, IState>{
lines.splice(0, 1)
const instances = lines
// for each row
// Revised the data type to support the category feature
instances.forEach((ins:string) => {
const values = ins.split(',')
values.forEach((v, idx)=>{
features[idx].data.push(parseFloat(v))
let _v = parseFloat(v)
if(isNaN(_v)){
features[idx].data.push(v)
}else{
features[idx].data.push(_v)
}
})
});
this.setState({
Expand Down Expand Up @@ -110,6 +115,7 @@ export default class DataView extends React.Component<{}, IState>{

//render
const { dataset } = this.state
console.log('this.state',this.state);
const classes = dataset.pop()
if(classes){
const features = dataset
Expand Down
Loading