Skip to content

Commit 8754bb5

Browse files
committed
[change] Change .travis.yml to install test
1 parent c22575f commit 8754bb5

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ install:
2626
script:
2727
- coverage run --source=nwtgck_hello_test setup.py test
2828

29+
- pip3 install --upgrade git+https://github.com/nwtgck/multi-svr-python.git@$TRAVIS_BRANCH
30+
- python examples/example1.py
31+
2932
after_success:
3033
- coveralls
3134

examples/example1.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import multi_svr
2+
from sklearn import metrics
3+
4+
X = [
5+
[0, 0],
6+
[0, 10],
7+
[1, 10],
8+
[1, 20],
9+
[1, 30],
10+
[1, 40]
11+
]
12+
13+
y = [
14+
[0, 0],
15+
[0, 10],
16+
[2, 10],
17+
[2, 20],
18+
[2, 30],
19+
[2, 40]
20+
]
21+
22+
# Create SVR
23+
regressor = multi_svr.MutilSVR(kernel='linear')
24+
# Fit
25+
regressor.fit(X, y)
26+
# Predict
27+
pred_y = regressor.predict(X)
28+
# Calc errors
29+
errs = metrics.mean_squared_error(y, pred_y)
30+
31+
print('pred_y:', pred_y)
32+
print('errs:', errs)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='multi_svr',
12-
version='0.1.0',
12+
version='0.1.1-SNAPSHOT',
1313
description='SVR for multidimensional label',
1414
author='Ryo Ota',
1515
author_email='[email protected]',

0 commit comments

Comments
 (0)