You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,16 @@ It works both in node.js and in the browser.
9
9
If you use npm, you can install it with:
10
10
11
11
```sh
12
-
npm install ecStat
12
+
npm install echarts-stat
13
13
```
14
-
14
+
15
15
Otherwise, download this tool from [dist directory](https://github.com/ecomfe/echarts-stat/tree/master/dist):
16
16
17
17
```html
18
18
<scriptsrc='./dist/ecStat.js'></script>
19
19
<script>
20
20
21
-
var result =ecStat.clustering.hierarchicalKMeans(data, clusterNumber, false);
21
+
var result =ecStat.clustering.hierarchicalKMeans(data, clusterNumber, false);
22
22
23
23
</script>
24
24
```
@@ -39,7 +39,7 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, stepBySte
39
39
```
40
40
##### Parameter
41
41
42
-
* data - `Two-dimensional Numeric Array`, each data point can have more than two numeric attributes in the original data set. In the following example, `data[0]` is called `data point` and `data[0][1]` is one of the numeric attributes of `data[0]`.
42
+
* data - `Two-dimensional Numeric Array`, each data point can have more than two numeric attributes in the original data set. In the following example, `data[0]` is called `data point` and `data[0][1]` is one of the numeric attributes of `data[0]`.
43
43
44
44
```js
45
45
var data = [
@@ -48,7 +48,7 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, stepBySte
48
48
[11, 12, 13, 14, 15],
49
49
...
50
50
];
51
-
```
51
+
```
52
52
* clusterNumer - `number`, the number of clusters generated
53
53
* stepByStep - `Boolean`, control whether doing the clustering step by step
54
54
@@ -68,7 +68,7 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, stepBySte
68
68
result.clusterAssment = [
69
69
70
70
[1, 0.145],
71
-
[2, 0.680],
71
+
[2, 0.680],
72
72
[0, 1.022],
73
73
...
74
74
];
@@ -79,7 +79,7 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, stepBySte
79
79
[0.335, -3.376],
80
80
[-0.994, -0.884],
81
81
...
82
-
],
82
+
],
83
83
...
84
84
];
85
85
```
@@ -88,17 +88,17 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, stepBySte
88
88
89
89
You can not only do cluster analysis through this interface, but also use [ECharts](https://github.com/ecomfe/echarts) to visualize the results.
90
90
91
-
Note: the clustering algorithm can handle multiple numeric attributes, but for the convenience of visualization, two numeric attributes are chosen here as an example.
91
+
Note: the clustering algorithm can handle multiple numeric attributes, but for the convenience of visualization, two numeric attributes are chosen here as an example.
92
92
93
-
##### Directly visualize the results of clustering
93
+
##### Directly visualize the results of clustering
var result =ecStat.clustering.hierarchicalKMeans(data, clusterNumber, true);
118
+
var result =ecStat.clustering.hierarchicalKMeans(data, clusterNumber, true);
119
119
120
120
</script>
121
121
```
@@ -127,7 +127,7 @@ var result = ecStat.clustering.hierarchicalKMeans(data, clusterNumber, true);
127
127
128
128
### Regression
129
129
130
-
Regression algorithm can according to the value of the dependent and independent variables of the data set, fitting out a curve to reflect their trends. The regression algorithm here only supports two numeric attributes.
130
+
Regression algorithm can according to the value of the dependent and independent variables of the data set, fitting out a curve to reflect their trends. The regression algorithm here only supports two numeric attributes.
131
131
132
132
#### Syntax
133
133
```
@@ -172,7 +172,7 @@ var myRegression = ecStat.regression(regressionType, data, order);
172
172
173
173
You can not only do regression analysis through this interface, you can also use [ECharts](https://github.com/ecomfe/echarts) to visualize the results.
0 commit comments