Skip to content

Commit 9089919

Browse files
authored
Add support proba svc; add pypi info; fix errors (#62)
1 parent c5ddd0e commit 9089919

File tree

14 files changed

+541
-58
lines changed

14 files changed

+541
-58
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,29 @@ Create a suitable conda environment for each framework to test. Each item in the
3939
* [**scikit-learn**](sklearn_bench#how-to-create-conda-environment-for-benchmarking)
4040

4141
```bash
42-
conda create -n bench -c intel python=3.7 scikit-learn scikit-learn-intelex pandas
42+
pip install -r sklearn_bench/requirements.txt
43+
# or
44+
conda install -c conda-forge scikit-learn scikit-learn-intelex pandas
4345
```
4446

4547
* [**daal4py**](daal4py_bench#how-to-create-conda-environment-for-benchmarking)
4648

4749
```bash
48-
conda create -n bench -c intel python=3.7 scikit-learn daal4py pandas
50+
conda install -c conda-forge scikit-learn daal4py pandas
4951
```
5052

5153
* [**cuml**](cuml_bench#how-to-create-conda-environment-for-benchmarking)
5254

5355
```bash
54-
conda create -n bench -c rapidsai -c conda-forge python=3.7 cuml pandas cudf
56+
conda install -c rapidsai -c conda-forge cuml pandas cudf
5557
```
5658

5759
* [**xgboost**](xgboost_bench#how-to-create-conda-environment-for-benchmarking)
5860

5961
```bash
60-
conda create -n bench -c conda-forge python=3.7 xgboost pandas
62+
pip install -r xgboost_bench/requirements.txt
63+
# or
64+
conda install -c conda-forge xgboost pandas
6165
```
6266

6367
## Running Python benchmarks with runner script
@@ -109,7 +113,7 @@ The configuration of benchmarks allows you to select the frameworks to run, sele
109113

110114
## Intel(R) Extension for Scikit-learn support
111115

112-
When you run scikit-learn benchmarks on CPU, [Intel(R) Extension for Scikit-learn](https://github.com/intel/scikit-learn-intelex) is used by default. Use the ``--no-intel-optimized`` option to run the benchmarks without the extension.
116+
When you run scikit-learn benchmarks on CPU, [Intel(R) Extension for Scikit-learn](https://github.com/intel/scikit-learn-intelex) is used by default. Use the ``--no-intel-optimized`` option to run the benchmarks without the extension.
113117

114118
The following benchmarks have a GPU support:
115119
* dbscan

bench.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,13 @@ def accuracy_score(y, yp):
340340
return columnwise_score(y, yp, lambda y1, y2: np.mean(y1 == y2))
341341

342342

343+
def log_loss(y, yp):
344+
from sklearn.metrics import log_loss as sklearn_log_loss
345+
y = convert_to_numpy(y)
346+
yp = convert_to_numpy(yp)
347+
return sklearn_log_loss(y, yp)
348+
349+
343350
def rmse_score(y, yp):
344351
return columnwise_score(
345352
y, yp, lambda y1, y2: float(np.sqrt(np.mean((y1 - y2)**2))))

configs/svm/svc_proba_cuml.json

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"common": {
3+
"lib": ["cuml"],
4+
"data-format": ["cudf"],
5+
"data-order": ["F"],
6+
"dtype": ["float64"],
7+
"max-cache-size": [2],
8+
"probability": [""]
9+
},
10+
"cases": [
11+
{
12+
"algorithm": "svm",
13+
"dataset": [
14+
{
15+
"source": "csv",
16+
"name": "ijcnn",
17+
"training":
18+
{
19+
"x": "data/ijcnn_x_train.csv",
20+
"y": "data/ijcnn_y_train.csv"
21+
},
22+
"testing":
23+
{
24+
"x": "data/ijcnn_x_test.csv",
25+
"y": "data/ijcnn_y_test.csv"
26+
}
27+
}
28+
],
29+
"C": [1000.0],
30+
"kernel": ["linear"]
31+
},
32+
{
33+
"algorithm": "svm",
34+
"dataset": [
35+
{
36+
"source": "csv",
37+
"name": "a9a",
38+
"training":
39+
{
40+
"x": "data/a9a_x_train.csv",
41+
"y": "data/a9a_y_train.csv"
42+
},
43+
"testing":
44+
{
45+
"x": "data/a9a_x_test.csv",
46+
"y": "data/a9a_y_test.csv"
47+
}
48+
}
49+
],
50+
"C": [500.0],
51+
"kernel": ["rbf"]
52+
},
53+
{
54+
"algorithm": "svm",
55+
"dataset": [
56+
{
57+
"source": "csv",
58+
"name": "gisette",
59+
"training":
60+
{
61+
"x": "data/gisette_x_train.csv",
62+
"y": "data/gisette_y_train.csv"
63+
},
64+
"testing":
65+
{
66+
"x": "data/gisette_x_test.csv",
67+
"y": "data/gisette_y_test.csv"
68+
}
69+
}
70+
],
71+
"C": [1.5e-3],
72+
"kernel": ["linear"]
73+
},
74+
{
75+
"algorithm": "svm",
76+
"dataset": [
77+
{
78+
"source": "csv",
79+
"name": "klaverjas",
80+
"training":
81+
{
82+
"x": "data/klaverjas_x_train.csv",
83+
"y": "data/klaverjas_y_train.csv"
84+
},
85+
"testing":
86+
{
87+
"x": "data/klaverjas_x_test.csv",
88+
"y": "data/klaverjas_y_test.csv"
89+
}
90+
}
91+
],
92+
"C": [1.0],
93+
"kernel": ["rbf"]
94+
},
95+
{
96+
"algorithm": "svm",
97+
"dataset": [
98+
{
99+
"source": "csv",
100+
"name": "connect",
101+
"training":
102+
{
103+
"x": "data/connect_x_train.csv",
104+
"y": "data/connect_y_train.csv"
105+
},
106+
"testing":
107+
{
108+
"x": "data/connect_x_test.csv",
109+
"y": "data/connect_y_test.csv"
110+
}
111+
}
112+
],
113+
"C": [100.0],
114+
"kernel": ["linear"]
115+
},
116+
{
117+
"algorithm": "svm",
118+
"dataset": [
119+
{
120+
"source": "csv",
121+
"name": "mnist",
122+
"training":
123+
{
124+
"x": "data/mnist_x_train.csv",
125+
"y": "data/mnist_y_train.csv"
126+
},
127+
"testing":
128+
{
129+
"x": "data/mnist_x_test.csv",
130+
"y": "data/mnist_y_test.csv"
131+
}
132+
}
133+
],
134+
"C": [50.0],
135+
"kernel": ["rbf"]
136+
},
137+
{
138+
"algorithm": "svm",
139+
"dataset": [
140+
{
141+
"source": "csv",
142+
"name": "sensit",
143+
"training":
144+
{
145+
"x": "data/sensit_x_train.csv",
146+
"y": "data/sensit_y_train.csv"
147+
},
148+
"testing":
149+
{
150+
"x": "data/sensit_x_test.csv",
151+
"y": "data/sensit_y_test.csv"
152+
}
153+
}
154+
],
155+
"C": [500.0],
156+
"kernel": ["linear"]
157+
},
158+
{
159+
"algorithm": "svm",
160+
"dataset": [
161+
{
162+
"source": "csv",
163+
"name": "skin_segmentation",
164+
"training":
165+
{
166+
"x": "data/skin_segmentation_x_train.csv",
167+
"y": "data/skin_segmentation_y_train.csv"
168+
},
169+
"testing":
170+
{
171+
"x": "data/skin_segmentation_x_test.csv",
172+
"y": "data/skin_segmentation_y_test.csv"
173+
}
174+
}
175+
],
176+
"C": [1.0],
177+
"kernel": ["rbf"]
178+
},
179+
{
180+
"algorithm": "svm",
181+
"dataset": [
182+
{
183+
"source": "csv",
184+
"name": "covertype",
185+
"training":
186+
{
187+
"x": "data/covertype_x_train.csv",
188+
"y": "data/covertype_y_train.csv"
189+
},
190+
"testing":
191+
{
192+
"x": "data/covertype_x_test.csv",
193+
"y": "data/covertype_y_test.csv"
194+
}
195+
}
196+
],
197+
"C": [100.0],
198+
"kernel": ["rbf"]
199+
},
200+
{
201+
"algorithm": "svm",
202+
"dataset": [
203+
{
204+
"source": "csv",
205+
"name": "codrnanorm",
206+
"training":
207+
{
208+
"x": "data/codrnanorm_x_train.csv",
209+
"y": "data/codrnanorm_y_train.csv"
210+
},
211+
"testing":
212+
{
213+
"x": "data/codrnanorm_x_test.csv",
214+
"y": "data/codrnanorm_y_test.csv"
215+
}
216+
}
217+
],
218+
"C": [1000.0],
219+
"kernel": ["linear"]
220+
}
221+
]
222+
}

0 commit comments

Comments
 (0)