Giter Site home page Giter Site logo

trink / symtseries Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 184 KB

C Library providing means of symbolic analysis on time series data currently based on iSAX paper (http://www.cs.ucr.edu/~eamonn/iSAX/iSAX.html)

License: Mozilla Public License 2.0

CMake 25.55% C 65.92% Lua 8.53%

symtseries's People

Contributors

quadrocube avatar spolakh avatar trink avatar

Stargazers

 avatar  avatar

Watchers

 avatar

symtseries's Issues

Expect "ECA" on the following tests

sax.word.new({1/0, 1/0, 1/0, 0, 0, 0, -1/0, -1/0, -1/0}, 9, 5) -- expect "ECA" gets "CCC"
sax.word.new({1/0, 1/0, 5, 0, 0, 0, -1/0, -1/0, -5}, 9, 5) -- correctly gets "ECA"

sax.word.new({0/0, 1/0, 1/0, 0, 0, 0, 0/0, -1/0, -1/0}, 9, 5) -- expect "ECA" gets "CCC"
sax.word.new({0/0, 5, 5, 0, 0, 0, 0/0, -5, -5}, 9, 5) -- correctly gets "ECA"

MinGW bulid errors on Windows

This build configuration is required for Heka

D:\work\symtseries\mingw32>mingw32-make
Scanning dependencies of target sts_test
[ 16%] Building C object src/CMakeFiles/sts_test.dir/symtseries.c.obj
D:\work\symtseries\src\symtseries.c: In function 'get_symbol':
D:\work\symtseries\src\symtseries.c:214:5: error: 'for' loop initial declarations are only allowed in C99 mode
D:\work\symtseries\src\symtseries.c:214:5: note: use option -std=c99 or -std=gnu99 to compile your code
D:\work\symtseries\src\symtseries.c: In function 'apply_sax_transform':

I thought the symtseries lib was going to be statically linked into the Lua wrapper .so

The library is pretty small so it would be nice to get rid of the extra dependency

ldd modules/sax.so
linux-vdso.so.1 => (0x00007ffe82340000)
libluasb.so.0 => /usr/lib/libluasb.so.0 (0x00007f009c544000)
libluasandbox.so.0 => /usr/lib/libluasandbox.so.0 (0x00007f009c33a000)
libsymtseries.so => /usr/local/lib/libsymtseries.so (0x00007f009c12f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f009bd6a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f009ba64000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f009b860000)
/lib64/ld-linux-x86-64.so.2 (0x00007f009c982000)

Visual Studio 2013 build errors

[ 16%] Building C object src/CMakeFiles/sts_test.dir/symtseries.c.obj
symtseries.c
D:\work\symtseries\src\symtseries.c(20) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(21) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(22) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(23) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(24) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(25) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(26) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(27) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(28) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(29) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(31) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(33) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(35) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(37) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(39) : warning C4056: overflow in floating-point constant arithmetic
D:\work\symtseries\src\symtseries.c(227) : error C2275: 'size_t' : illegal use of this type as an expression
        D:\work\symtseries\src\symtseries.c : see declaration of 'size_t'
D:\work\symtseries\src\symtseries.c(227) : error C2146: syntax error : missing ';' before identifier 'actual_n_values'
D:\work\symtseries\src\symtseries.c(227) : error C2065: 'actual_n_values' : undeclared identifier
D:\work\symtseries\src\symtseries.c(227) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
D:\work\symtseries\src\symtseries.c(241) : error C2065: 'actual_n_values' : undeclared identifier
D:\work\symtseries\src\symtseries.c(246) : error C2065: 'actual_n_values' : undeclared identifier
D:\work\symtseries\src\symtseries.c(253) : error C2065: 'actual_n_values' : undeclared identifier
D:\work\symtseries\src\symtseries.c(257) : error C2065: 'actual_n_values' : undeclared identifier
D:\work\symtseries\src\symtseries.c(318) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible lo
ss of data
D:\work\symtseries\src\symtseries.c(353) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(369) : error C2275: 'size_t' : illegal use of this type as an expression
        D:\work\symtseries\src\symtseries.c : see declaration of 'size_t'
D:\work\symtseries\src\symtseries.c(369) : error C2146: syntax error : missing ';' before identifier 'start'
D:\work\symtseries\src\symtseries.c(369) : error C2065: 'start' : undeclared identifier
D:\work\symtseries\src\symtseries.c(370) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
D:\work\symtseries\src\symtseries.c(371) : error C2065: 'start' : undeclared identifier
D:\work\symtseries\src\symtseries.c(393) : error C2275: 'size_t' : illegal use of this type as an expression
        D:\work\symtseries\src\symtseries.c : see declaration of 'size_t'
D:\work\symtseries\src\symtseries.c(393) : error C2146: syntax error : missing ';' before identifier 'w'
D:\work\symtseries\src\symtseries.c(393) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(393) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
D:\work\symtseries\src\symtseries.c(394) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(396) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(398) : warning C4267: '=' : conversion from 'size_t' to 'sts_symbol', possible loss of data
D:\work\symtseries\src\symtseries.c(400) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(400) : warning C4267: 'function' : conversion from 'size_t' to 'short', possible loss of data
D:\work\symtseries\src\symtseries.c(414) : warning C4267: '=' : conversion from 'size_t' to 'char', possible loss of data
D:\work\symtseries\src\symtseries.c(423) : error C2275: 'size_t' : illegal use of this type as an expression
        D:\work\symtseries\src\symtseries.c : see declaration of 'size_t'
D:\work\symtseries\src\symtseries.c(423) : error C2146: syntax error : missing ';' before identifier 'w'
D:\work\symtseries\src\symtseries.c(423) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(423) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
D:\work\symtseries\src\symtseries.c(427) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible lo
ss of data
D:\work\symtseries\src\symtseries.c(433) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(442) : error C2065: 'w' : undeclared identifier
D:\work\symtseries\src\symtseries.c(473) : error C2275: 'sts_symbol' : illegal use of this type as an expression
        D:\work\symtseries\include\symtseries.h(18) : see declaration of 'sts_symbol'
D:\work\symtseries\src\symtseries.c(473) : error C2065: 'sts_symbols' : undeclared identifier
D:\work\symtseries\src\symtseries.c(473) : error C2100: illegal indirection
D:\work\symtseries\src\symtseries.c(474) : error C2065: 'sts_symbols' : undeclared identifier
D:\work\symtseries\src\symtseries.c(474) : warning C4022: 'memcpy' : pointer mismatch for actual parameter 1
D:\work\symtseries\src\symtseries.c(474) : error C2100: illegal indirection
D:\work\symtseries\src\symtseries.c(475) : warning C4267: 'function' : conversion from 'size_t' to 'short', possible loss of data
D:\work\symtseries\src\symtseries.c(475) : error C2065: 'sts_symbols' : undeclared identifier
D:\work\symtseries\src\symtseries.c(475) : warning C4047: 'function' : 'sts_symbol *' differs in levels of indirection from 'int'
D:\work\symtseries\src\symtseries.c(475) : warning C4024: 'new_word' : different types for formal and actual parameter 4
D:\work\symtseries\src\symtseries.c(492) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(494) : warning C4013: 'snprintf' undefined; assuming extern returning int
D:\work\symtseries\src\symtseries.c(502) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(517) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(518) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(573) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss o
f data
D:\work\symtseries\src\symtseries.c(637) : warning C4056: overflow in floating-point constant arithmetic
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~4.0\VC\bin\amd64\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.

build failed with msvc2013

F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(46) : error C2220: 警告被视为错误 - 没有生成“object”文件
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(46) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(54) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(61) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(69) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(78) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(88) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(99) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(111) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(124) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(138) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(153) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(169) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(186) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(204) : warning C4305: “初始化”: 从“double”到“const float”截断
F:\developing\c\lua_sandbox\release\ep_base\Source\lua_sax\src\symtseries.c(223) : warning C4305: “初始化”: 从“double”到“const float”截断

Expect the sandbox output of a sax.window/word to be a human readable sax string

The current window output is binary dump of a struct and the word output appears to be a Lua table. I would prefer just the SAX string e.g. ABBAC.

However, it would be nice to account for the cardinality so I am open to other suggestion. The iSAX binary representation isn't unambiguous since we aren't restricted to powers of 2. The exponentiation representation wasn't bad but overkill on every symbol, maybe just tack it onto the end ABBAC^4?

Performance of sax_transform

Check out whether dumping the normalization_buffer would be worse it
If yes, screw it and merge normalization with symbol estimation

  • (thanks trink for reminding) keep running average and std if operating with sts_window

The lua wrapper fails to compile when building against the lua_sandbox

/work/git/lua_sandbox/release/ep_base/Source/lua_sax/lua/lua_sax.c: In function ‘output_sax’:
/work/git/lua_sandbox/release/ep_base/Source/lua_sax/lua/lua_sax.c:347:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
/work/git/lua_sandbox/release/ep_base/Source/lua_sax/lua/lua_sax.c: In function ‘serialize_sax’:
/work/git/lua_sandbox/release/ep_base/Source/lua_sax/lua/lua_sax.c:324:1: error: control reaches end of non-void function [-Werror=return-type]
}

Cannot create a .deb package with cpack

trink@trink-x230:/work/git/symtseries/release$ cpack -G DEB
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: symtseries
CPack: - Install project: symtseries
CPack: Create package
CMake Error at /usr/local/stow/cmake-3_0_2/share/cmake-3.0/Modules/CPackDeb.cmake:370 (message):
CPackDeb: Debian package requires a maintainer for a package, set
CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.