Skip to content

Commit f647c60

Browse files
authored
Adding kshape binding (#42)
* Adding kshape binding * Fix documentation * Updating copyright year to 2019 * Testing clustering tests on Travis * New tests for kmeans. * New test for kmeans
1 parent 8b5c749 commit f647c60

52 files changed

Lines changed: 236 additions & 56 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.CI/travis/build_and_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2018 Shapelets.io
2+
# Copyright (c) 2019 Shapelets.io
33
#
44
# This Source Code Form is subject to the terms of the Mozilla Public
55
# License, v. 2.0. If a copy of the MPL was not distributed with this

.CI/travis/install-arrayfire.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2018 Shapelets.io
2+
# Copyright (c) 2019 Shapelets.io
33
#
44
# This Source Code Form is subject to the terms of the Mozilla Public
55
# License, v. 2.0. If a copy of the MPL was not distributed with this

.CI/travis/install-khiva.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2018 Shapelets.io
2+
# Copyright (c) 2019 Shapelets.io
33
#
44
# This Source Code Form is subject to the terms of the Mozilla Public
55
# License, v. 2.0. If a copy of the MPL was not distributed with this

.CI/travis/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2018 Shapelets.io
2+
# Copyright (c) 2019 Shapelets.io
33
#
44
# This Source Code Form is subject to the terms of the Mozilla Public
55
# License, v. 2.0. If a copy of the MPL was not distributed with this

.appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018 Shapelets.io
1+
# Copyright (c) 2019 Shapelets.io
22
#
33
# This Source Code Form is subject to the terms of the Mozilla Public
44
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -27,8 +27,8 @@ before_build:
2727
- reg add HKCU\Software\Kitware\CMake\Packages\ArrayFire /v ArrayFire_CMake_DIR /d "C:\Program Files\ArrayFire\v3\cmake" /f
2828
- vcpkg install --triplet x64-windows gtest eigen3
2929
- ps: if ($env:INSTALL_KHIVA_METHOD -eq "installer"){
30-
if(!(Test-Path -Path "C:\Program Files\Khiva" )){ appveyor DownloadFile "https://github.com/shapelets/khiva/releases/download/v0.1.0/khiva-v0.1.0-unattended.exe" -FileName khiva-v0.1.0-unattended.exe };
31-
if(!(Test-Path -Path "C:\Program Files\Khiva" )){ .\khiva-v0.1.0-unattended.exe /S };
30+
if(!(Test-Path -Path "C:\Program Files\Khiva" )){ appveyor DownloadFile "https://github.com/shapelets/khiva/releases/download/v0.2.0/khiva-v0.2.0-unattended.exe" -FileName khiva-v0.2.0-unattended.exe };
31+
if(!(Test-Path -Path "C:\Program Files\Khiva" )){ .\khiva-v0.2.0-unattended.exe /S };
3232
}else{
3333
git clone -q https://github.com/shapelets/khiva.git C:\khiva-library ;
3434
cd C:\khiva-library;

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ If some members of staff were angered by the incident, it is best to apologise t
9090

9191
## Attribution
9292

93-
This Code of Conduct was adapted from both [Golang](https://golang.org/conduct) an the [Golang UK Conference](http://golanguk.com/conduct/).
93+
This Code of Conduct was adapted from both [Golang](https://golang.org/conduct) an the [Golang UK Conference](http://golanguk.com/conduct/).

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ ENV/
104104
./docs/build/
105105

106106
#IntelliJ files.
107-
.idea
107+
.idea

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018 Shapelets.io
1+
# Copyright (c) 2019 Shapelets.io
22
#
33
# This Source Code Form is subject to the terms of the Mozilla Public
44
# License, v. 2.0. If a copy of the MPL was not distributed with this

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
360360
This Source Code Form is "Incompatible
361361
With Secondary Licenses", as defined by
362362
the Mozilla Public License, v. 2.0.
363-
363+

benchmarks/matrix.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
import scipy.io
3+
import matplotlib.pyplot as plt
4+
import khiva as kv
5+
import os
6+
import time
7+
8+
print(kv.get_backend())
9+
os.chdir("/Users/antonio.vilches/repositories/khiva-python/benchmarks")
10+
11+
print(os.getcwd())
12+
13+
14+
mat = scipy.io.loadmat('./sel102m.mat')
15+
plt.plot(range(len(mat['val'][1])), mat['val'][1])
16+
plt.show()
17+
18+
start = time.time()
19+
20+
l = 400
21+
lecg = len(mat['val'][1])
22+
min = 50000
23+
max = 60000
24+
25+
b = mat['val'][1][min:max]
26+
a = kv.Array(b)
27+
a2 = kv.Array(b)
28+
profile, index = kv.stomp(a, a2, l)
29+
distance, index, subsequence = kv.find_best_n_discords(profile, index, l, 1)
30+
31+
plt.plot(
32+
range(len(mat['val'][1])),
33+
mat['val'][1]
34+
)
35+
plt.plot(
36+
range(len(mat['val'][1]))[int(min + subsequence.to_list()):int(min + subsequence.to_list() + l)],
37+
mat['val'][1][int(min + subsequence.to_list()):int(min + subsequence.to_list() + l)]
38+
)
39+
40+
plt.show()
41+
42+
end = time.time()
43+
print("Execution time: " + str(end - start))

0 commit comments

Comments
 (0)