fbarrios / turtle Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jackdoe/turtle
pure java vowpal wabbit model reader and predictions
This project forked from jackdoe/turtle
pure java vowpal wabbit model reader and predictions
# turtle - load readable_model from vowpal wabbit and serve it from java ## example train a model $ vw -d /path/to/dataset/dataset --readable_model readable_model.txt ## readable_model.txt looks like: ... 6163:0.0624969 7472:-0.12023 42847:-0.0421919 49960:-0.12023 51692:0.0624969 55432:-0.0421919 ... using https://gist.github.com/luoq/b4c374b5cbabe3ae76ffacdac22750af, and some logic to produce the same buckets for the same feature combinations ## java code add the dependency in pom.xml <dependency> <groupId>bz.turtle</groupId> <artifactId>readable</artifactId> <version>2.0.4-BETA</version> </dependency> import bz.turtle.readable.*; ReadableModel m = new ReadableModel("directory/of/readable_model.txt"); // .txt.gz also works // this will load the model creating only float[] array with same size as 2**bits(-b from vw) // it uses same algorithm to compute hash buckets as vw and then returns the inner product m.predict( new Doc( new Namespace( "your-namespace", new Feature("a",1.0), new Feature("b",1.0), new Feature("c",1.0)))); // value 1.0 is default ## make sure it works if you want to make sure your parameters are supported, in the repeatable_model.txt add test.txt and predictions.txt (using -p from vw) and it will automatically test if turtle gets the same predictions as the wabbit. if you pass file to ReadableModel it will just try to load the file check out resources/test for more examples ## known bugs * -q :: the way vw does permutation is different, and it produces different results ## thanks * Lucas Bernardi * Tarek Sheasha * Denis Bilenko wouldn't have happened without the help of those guys ## todo * more tests * verify the checksum of the model * support for --cubic * support for ngrams and skips * support for --lrq
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.