Skip to content

Add Linear Regression to Aggregator #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
5e632cc
ml linear regression
giangnm58 Apr 10, 2020
f4ebacf
small fix
giangnm58 Apr 10, 2020
0f69517
linear regresion
giangnm58 Apr 20, 2020
ac90513
linear regresion
giangnm58 Apr 20, 2020
baf49e3
linear regresion small fix
giangnm58 Apr 20, 2020
e3d6da8
linear regression small fix
giangnm58 Apr 20, 2020
8f653fc
fix model type bug
giangnm58 Apr 23, 2020
4fd504a
linear regression fixing bug type
giangnm58 Apr 24, 2020
906c82e
linear regression fixing bug type
giangnm58 Apr 24, 2020
bb5088e
fix constructor bug
giangnm58 Apr 27, 2020
a41cf6a
add test case
giangnm58 Apr 27, 2020
5605f28
add weka jars
giangnm58 Apr 27, 2020
472d822
add weka jar and test cases into correct folders
Apr 27, 2020
55aa854
adding/removing line breaks
giangnm58 Apr 27, 2020
4cb9999
Merge branch 'master' of https://github.com/giangnm58/compiler
giangnm58 Apr 27, 2020
6f24ca4
adding/removing line breaks
giangnm58 Apr 27, 2020
7aa7638
adding/removing line breaks
giangnm58 Apr 27, 2020
1e7c026
adding/removing line breaks
giangnm58 Apr 27, 2020
127b846
change boatup to boa.runtime.Tuple
giangnm58 Apr 27, 2020
98bd417
edit .classpath
giangnm58 Apr 27, 2020
ed328d9
edit .classpath
giangnm58 Apr 27, 2020
636c9d2
remove unnecessary jar file
giangnm58 Apr 27, 2020
4a4ca6f
edit .classpath
giangnm58 Apr 27, 2020
dd644ca
edit .gitignore
giangnm58 Apr 27, 2020
2f03515
edit .classpath
giangnm58 Apr 27, 2020
bbea155
fix according to Dr. Robert comments
giangnm58 May 4, 2020
ecae915
small fix
giangnm58 May 4, 2020
4726525
small fix
giangnm58 May 4, 2020
5467571
edit classpath
giangnm58 May 4, 2020
df2995e
fix ML type to string
giangnm58 May 4, 2020
dbf897f
update test cases
giangnm58 May 4, 2020
4741988
update according to Dr. Robert comments
giangnm58 May 4, 2020
3b131e9
update according to Dr. Robert comments
giangnm58 May 4, 2020
afbcf3c
update according to Dr. Robert comments
giangnm58 May 4, 2020
6be1a0e
update according to Dr. Robert comments
giangnm58 May 4, 2020
37b7dd6
update according to Dr. Robert comments
giangnm58 May 4, 2020
7e2e42d
update according to Dr. Robert comments
giangnm58 May 4, 2020
fc46df8
update according to Dr. Robert comments
giangnm58 May 4, 2020
17369c9
update according to Dr. Robert comments
giangnm58 May 5, 2020
087cdd4
Merge branch 'master' into master
giangnm58 May 30, 2020
6c6bf2e
Merge pull request #266 from giangnm58/master
hyjorc1 May 31, 2020
2cb9e97
Update .classpath
giangnm58 Jun 1, 2020
f3cc86f
Update TestParserBad.java
giangnm58 Jun 1, 2020
69f1c94
Delete Query.jar
giangnm58 Jun 1, 2020
3d1d189
Update .classpath
giangnm58 Jun 1, 2020
59cd224
Merge pull request #268 from giangnm58/master
hyjorc1 Jun 2, 2020
0ae8239
Update classes_at_revision_test.boa
giangnm58 Jun 3, 2020
6a41d04
Merge pull request #269 from giangnm58/master
hyjorc1 Jun 5, 2020
815bb50
fix classpath
hyjorc1 Jun 5, 2020
71af836
update classpath
hyjorc1 Jun 5, 2020
19ac08d
minor fix and update classpath
hyjorc1 Jun 5, 2020
1eb54bc
change save and load model path
hyjorc1 Jun 5, 2020
5e9df22
Merge branch 'ml-2020' of https://github.com/giangnm58/compiler.git into
hyjorc1 Jun 5, 2020
7335868
1. move load and classify funcs to BoaMLIntrinsics. 2. use job id and
hyjorc1 Jun 7, 2020
7fac126
Merge pull request #270 from giangnm58/master
hyjorc1 Jun 7, 2020
2d4b89f
add examples of training/testing multiple models
hyjorc1 Jun 7, 2020
5eb917a
add model evaluation and dataset split functionalities
hyjorc1 Jun 8, 2020
3985e1c
Merge pull request #271 from giangnm58/master
hyjorc1 Jun 8, 2020
e7acf08
add adaboost aggregator
giangnm58 Jun 12, 2020
d281815
Update .classpath
giangnm58 Jun 12, 2020
ac6f9ea
Update adaboost train.boa
giangnm58 Jun 12, 2020
a3c02c0
Update AdaBoostM1Aggregator.java
giangnm58 Jun 12, 2020
df8d77d
Merge branch 'master' of https://github.com/boalang/compiler.git
hyjorc1 Jun 13, 2020
716009f
Merge branch 'master' of https://github.com/giangnm58/compiler.git
hyjorc1 Jun 13, 2020
f57436a
minor fix
hyjorc1 Jun 13, 2020
53fd8f4
minor fix and clean up
hyjorc1 Jun 13, 2020
913ae5b
minor fix
hyjorc1 Jun 13, 2020
e203e45
change example query
hyjorc1 Jun 13, 2020
c431a30
fix example query
hyjorc1 Jun 13, 2020
ffa3861
change train example query for adaboost
hyjorc1 Jun 13, 2020
258c50b
clean BoaReducer
hyjorc1 Jun 14, 2020
2768a73
1. BoaTuple works with enum 2. clean BoaReducer 3. update EmitValue
hyjorc1 Jun 15, 2020
e91e54a
fix ml aggregator with tuple input
hyjorc1 Jun 15, 2020
3924bfd
fix conflicts between string[] and tuple data type
hyjorc1 Jun 15, 2020
adeeef3
1. fix model type and tuple type 2. update example queries 3. add
hyjorc1 Jun 15, 2020
1c6338d
fix tuple bug in the code generator
hyjorc1 Jun 15, 2020
c90fa2d
clean reducer and MLAggregator to handle string[] or tuple only
hyjorc1 Jun 15, 2020
e66d710
remove typecast
hyjorc1 Jun 15, 2020
299feb7
add codegen test cases for ada and linear regression
hyjorc1 Jun 15, 2020
0f35af0
fix ml types
hyjorc1 Jun 16, 2020
294f115
Temporarily fix ml types. Need to discuss it.
hyjorc1 Jun 16, 2020
df3993c
Temporarily fix ml types
hyjorc1 Jun 16, 2020
6b9d8e6
add zeror aggregator
hyjorc1 Jun 17, 2020
e43b62a
clean up
hyjorc1 Jun 17, 2020
10eb490
add vote aggregator
hyjorc1 Jun 17, 2020
89e5ba3
add SMO aggregator
hyjorc1 Jun 17, 2020
064afb6
add kmeans (clusterer) aggregator
hyjorc1 Jun 17, 2020
5873416
add randomforest (classifier) aggregator
hyjorc1 Jun 17, 2020
279a5e4
add additiveregression
giangnm58 Jun 17, 2020
4e70ad5
add attribute selected classifier
giangnm58 Jun 17, 2020
3ca7bfc
clean up
hyjorc1 Jun 17, 2020
bd51e98
add part (classifier) aggregator
hyjorc1 Jun 17, 2020
0e289f4
add oner (classifier) aggregator
hyjorc1 Jun 17, 2020
dac9065
fix oner test,boa
hyjorc1 Jun 17, 2020
3f74b0f
add NaiveBayesMultinomialUpdateable (classifier) aggregator
hyjorc1 Jun 17, 2020
8f13e4a
add NaiveBayesMultinomial (classifier - not done)
hyjorc1 Jun 17, 2020
c106b36
add naive bayes (classifier) aggregator
hyjorc1 Jun 17, 2020
aa3dfd3
add MultiScheme (classifier) aggregator
hyjorc1 Jun 18, 2020
5dbf632
add MultiClassClassifier and MultilayerPerceptron (classifiers)
hyjorc1 Jun 18, 2020
2c0a633
add bagging aggregator
giangnm58 Jun 18, 2020
1ed0bc8
add bayesnet aggregator
giangnm58 Jun 18, 2020
276d230
add ClassificationViaRegression aggregator
giangnm58 Jun 18, 2020
cf26af2
clean up
hyjorc1 Jun 18, 2020
df53da2
use m = load(0, m); to load trained model
hyjorc1 Jun 18, 2020
25aa59a
add lwl and logitbosst (classifiers) aggregators
hyjorc1 Jun 18, 2020
1282ccb
add lmt and logistic (classifiers) aggregators
hyjorc1 Jun 18, 2020
5dfa05d
add j48, jrip, and kstar (classifiers) aggregators
hyjorc1 Jun 18, 2020
d9b2d53
add CVParameterSelection aggregator
giangnm58 Jun 19, 2020
985b3c5
add decision stump aggregator
giangnm58 Jun 19, 2020
24bf897
add decision table aggregator
giangnm58 Jun 19, 2020
cda67a6
add Filtered Classifier aggregator
giangnm58 Jun 19, 2020
d771491
clean up
hyjorc1 Jun 19, 2020
de23333
add ml aggregators
giangnm58 Jun 23, 2020
2f10bc7
add ml aggregators
giangnm58 Jun 23, 2020
f673134
add type checking
giangnm58 Jun 23, 2020
e3721e9
add word2vec
hyjorc1 Jun 28, 2020
2b51992
add seq2vec
hyjorc1 Jun 29, 2020
51d854b
Merge branch 'ml-2020' into master
hyjorc1 Jul 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 55 additions & 6 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
<classpathentry kind="lib" path="rtlib/scannotation-1.0.3.jar"/>
<classpathentry kind="lib" path="rtlib/ST-4.0.8.jar"/>
<classpathentry kind="lib" path="lib/antlr-4.5-complete.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="lib/commons-math-2.1.jar"/>
<classpathentry kind="lib" path="lib/hadoop-core-1.0.4.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-all-1.3.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/mrunit-0.9.0-incubating-hadoop1.jar"/>
<classpathentry kind="lib" path="lib/datagen/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/datagen/cssparser-0.9.23.jar"/>
<classpathentry kind="lib" path="lib/datagen/dom4j-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/datagen/eclipse.jdt.core.jar"/>
<classpathentry kind="lib" path="lib/datagen/gson-2.7.jar"/>
<classpathentry kind="lib" path="lib/datagen/jsoup-1.10.3.jar"/>
<classpathentry kind="lib" path="lib/datagen/maven-model-3.0.jar"/>
<classpathentry kind="lib" path="lib/datagen/org.eclipse.core.contenttype_3.4.100.dist.jar"/>
Expand Down Expand Up @@ -63,8 +60,6 @@
<classpathentry kind="lib" path="lib/datagen/org.eclipse.text-3.5.101-sources.jar"/>
<classpathentry kind="lib" path="lib/datagen/org.eclipse.text-3.5.101.jar"/>
<classpathentry kind="lib" path="lib/datagen/protobuf-java-2.5.0.jar"/>
<classpathentry kind="lib" path="lib/datagen/slf4j-api-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/datagen/slf4j-log4j12-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/datagen/svnkit-1.7.6.jar"/>
<classpathentry kind="lib" path="lib/datagen/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/datagen/xml-apis.jar"/>
Expand All @@ -74,7 +69,61 @@
<classpathentry kind="lib" path="lib/evaluator/com.springsource.org.codehaus.jackson.mapper-1.4.2.jar"/>
<classpathentry kind="lib" path="lib/evaluator/commons-configuration-1.6.jar"/>
<classpathentry kind="lib" path="lib/evaluator/commons-httpclient-3.1.0.redhat-7.jar"/>
<classpathentry kind="lib" path="lib/evaluator/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="compile"/>
<classpathentry kind="lib" path="lib/weka/arpack_combined.jar"/>
<classpathentry kind="lib" path="lib/weka/core.jar"/>
<classpathentry kind="lib" path="lib/weka/mtj.jar"/>
<classpathentry kind="lib" path="lib/weka/weka.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-compress-1.18.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-lang3-3.6.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-math3-3.5.jar"/>
<classpathentry kind="lib" path="lib/dl4j/deeplearning4j-common-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/deeplearning4j-nlp-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/deeplearning4j-nn-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/gson-2.8.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/guava-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/jackson-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-platform-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacv-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-api-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-common-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-1.0.0-beta7-linux-armhf.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-1.0.0-beta7-linux-ppc64le.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-1.0.0-beta7-linux-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-1.0.0-beta7-macosx-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-api-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nd4j-native-platform-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/nearestneighbor-core-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/neoitertools-1.0.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-linux-arm64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-linux-armhf.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-linux-ppc64le.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-linux-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-linux-x86.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3-macosx-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-0.3.9-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/openblas-platform-0.3.9-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/opencsv-2.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/opencv-platform-4.3.0-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/dl4j/protobuf-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/slf4j-api-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/dl4j/slf4j-simple-1.7.21.jar"/>
<classpathentry kind="lib" path="lib/dl4j/threadly-4.10.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-linux-arm64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-linux-armhf.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-linux-ppc64le.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-linux-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-linux-x86.jar"/>
<classpathentry kind="lib" path="lib/dl4j/javacpp-1.5.3-macosx-x86_64.jar"/>
<classpathentry kind="lib" path="lib/dl4j/jna-4.3.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/jna-platform-4.3.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/deeplearning4j-core-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/deeplearning4j-tsne-1.0.0-beta7.jar"/>
<classpathentry kind="lib" path="lib/dl4j/flatbuffers-java-1.10.0.jar"/>
<classpathentry kind="lib" path="lib/dl4j/commons-lang-2.6.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Binary file added Run.jar
Binary file not shown.
Binary file added lib/dl4j/commons-codec-1.10.jar
Binary file not shown.
Binary file added lib/dl4j/commons-compress-1.18.jar
Binary file not shown.
Binary file added lib/dl4j/commons-io-2.5.jar
Binary file not shown.
Binary file added lib/dl4j/commons-lang-2.6.jar
Binary file not shown.
Binary file added lib/dl4j/commons-lang3-3.6.jar
Binary file not shown.
Binary file added lib/dl4j/commons-math3-3.5.jar
Binary file not shown.
Binary file added lib/dl4j/deeplearning4j-common-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/deeplearning4j-core-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/deeplearning4j-nlp-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/deeplearning4j-nn-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/deeplearning4j-tsne-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/flatbuffers-java-1.10.0.jar
Binary file not shown.
Binary file added lib/dl4j/gson-2.8.0.jar
Binary file not shown.
Binary file added lib/dl4j/guava-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/jackson-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-linux-arm64.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-linux-armhf.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-linux-ppc64le.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-linux-x86.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-linux-x86_64.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3-macosx-x86_64.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/javacpp-platform-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/javacv-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/jna-4.3.0.jar
Binary file not shown.
Binary file added lib/dl4j/jna-platform-4.3.0.jar
Binary file not shown.
Binary file added lib/dl4j/nd4j-api-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/nd4j-common-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/nd4j-native-1.0.0-beta7-linux-armhf.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/dl4j/nd4j-native-1.0.0-beta7-linux-x86_64.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/dl4j/nd4j-native-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/nd4j-native-api-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/nd4j-native-platform-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/nearestneighbor-core-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/neoitertools-1.0.0.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-linux-arm64.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-linux-armhf.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-linux-ppc64le.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-linux-x86.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-linux-x86_64.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3-macosx-x86_64.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-0.3.9-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/openblas-platform-0.3.9-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/opencsv-2.3.jar
Binary file not shown.
Binary file added lib/dl4j/opencv-platform-4.3.0-1.5.3.jar
Binary file not shown.
Binary file added lib/dl4j/protobuf-1.0.0-beta7.jar
Binary file not shown.
Binary file added lib/dl4j/slf4j-api-1.7.21.jar
Binary file not shown.
Binary file added lib/dl4j/slf4j-simple-1.7.21.jar
Binary file not shown.
Binary file added lib/dl4j/threadly-4.10.0.jar
Binary file not shown.
Binary file added lib/weka/arpack_combined.jar
Binary file not shown.
Binary file added lib/weka/core.jar
Binary file not shown.
Binary file added lib/weka/mtj.jar
Binary file not shown.
Binary file added lib/weka/weka.jar
Binary file not shown.
10 changes: 9 additions & 1 deletion src/antlr/Boa.g
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ type returns [AbstractType ast]
| q=queueType { $ast = $q.ast; }
| set=setType { $ast = $set.ast; }
| e=enumType { $ast = $e.ast; }
| model=modelType { $ast = $model.ast; }
| id=identifier { $ast = $id.ast; }
;

Expand Down Expand Up @@ -202,7 +203,12 @@ outputType returns [OutputType ast]
@after { $ast.setPositions($l, $c, getEndLine(), getEndColumn()); }
: OUTPUT (tk=SET { $ast = new OutputType((Identifier)new Identifier($tk.text).setPositions(getStartLine($tk), getStartColumn($tk), getEndLine($tk), getEndColumn($tk))); } | id=identifier { $ast = new OutputType($id.ast); }) (LPAREN el=expressionList RPAREN { $ast.setArgs($el.list); })? (LBRACKET m=component RBRACKET { $ast.addIndice($m.ast); })* OF m=component { $ast.setType($m.ast); } (WEIGHT m=component { $ast.setWeight($m.ast); })? (FORMAT LPAREN el=expressionList RPAREN)?
;

modelType returns [ModelType ast]
locals [int l, int c]
@init { $l = getStartLine(); $c = getStartColumn(); }
@after { $ast.setPositions($l, $c, getEndLine(), getEndColumn()); }
: MODEL OF id=identifier { $ast = new ModelType($id.ast); } OF m=component { $ast.setType($m.ast); }
;
functionType returns [FunctionType ast]
locals [int l, int c]
@init {
Expand Down Expand Up @@ -610,6 +616,7 @@ identifier returns [Identifier ast]
| lit=MAP { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=STACK { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=QUEUE { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=MODEL { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=SET { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=FOR { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=FOREACH { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
Expand Down Expand Up @@ -690,6 +697,7 @@ DO : 'do';
MAP : 'map';
STACK : 'stack';
QUEUE : 'queue';
MODEL : 'model';
SET : 'set';
FOR : 'for';
FOREACH : 'foreach';
Expand Down
7 changes: 7 additions & 0 deletions src/antlr/BoaNoActions.g
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type
| queueType
| setType
| enumType
| modelType
| identifier
;

Expand Down Expand Up @@ -103,6 +104,10 @@ setType
outputType
: OUTPUT (SET | identifier) (LPAREN expressionList RPAREN)? (LBRACKET component RBRACKET)* OF component (WEIGHT component)? (FORMAT LPAREN expressionList RPAREN)?
;

modelType
: MODEL of identifier OF component
;

functionType
: FUNCTION LPAREN (identifier COLON type (COMMA identifier COLON type)*)? RPAREN (COLON type)?
Expand Down Expand Up @@ -352,6 +357,7 @@ identifier
| lit=MAP { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=STACK { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=QUEUE { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=MODEL { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=SET { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=FOR { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
| lit=FOREACH { notifyErrorListeners("keyword '" + $lit.text + "' can not be used as an identifier"); }
Expand Down Expand Up @@ -417,6 +423,7 @@ DO : 'do';
MAP : 'map';
STACK : 'stack';
QUEUE : 'queue';
MODEL : 'model';
SET : 'set';
FOR : 'for';
FOREACH : 'foreach';
Expand Down
1 change: 1 addition & 0 deletions src/java/boa/aggregators/Aggregator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import boa.functions.BoaCasts;
import boa.io.EmitKey;
import boa.io.EmitValue;
import boa.runtime.Tuple;

/**
* The base class for all Boa aggregators.
Expand Down
70 changes: 70 additions & 0 deletions src/java/boa/aggregators/ml/AdaBoostM1Aggregator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2014, Hridesh Rajan, Robert Dyer,
* and Iowa State University of Science and Technology
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boa.aggregators.ml;

import boa.runtime.Tuple;
import boa.aggregators.AggregatorSpec;
import weka.classifiers.meta.AdaBoostM1;
import java.io.IOException;

/**
* A Boa aggregator for training the model using AdaBoostM1.
*
* @author ankuraga
* @author nmtiwari
*/
@AggregatorSpec(name = "adaboost", formalParameters = { "string" })
public class AdaBoostM1Aggregator extends MLAggregator {
private AdaBoostM1 model;

public AdaBoostM1Aggregator() {
}

public AdaBoostM1Aggregator(final String s) {
super(s);
}

@Override
public void aggregate(final String[] data, String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AdaBoostM1");
}

@Override
public void aggregate(final Tuple data, final String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AdaBoostM1");
}

@Override
public void aggregate(String data, String metadata) throws IOException, InterruptedException {
}

@Override
public void finish() throws IOException, InterruptedException {
try {
this.model = new AdaBoostM1();
this.model.setOptions(options);
this.model.buildClassifier(this.trainingSet);
} catch (Exception e) {
e.printStackTrace();
}
this.saveModel(this.model);
this.evaluate(this.model, this.trainingSet);
this.evaluate(this.model, this.testingSet);
this.collect(this.model.toString());
}

}
70 changes: 70 additions & 0 deletions src/java/boa/aggregators/ml/AdditiveRegressionAggregator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2014, Hridesh Rajan, Robert Dyer,
* and Iowa State University of Science and Technology
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boa.aggregators.ml;

import boa.runtime.Tuple;
import boa.aggregators.AggregatorSpec;
import weka.classifiers.meta.AdditiveRegression;
import java.io.IOException;

/**
* A Boa aggregator for training the model using AdditiveRegression.
*
* @author ankuraga/
* @author nmtiwari
*/
@AggregatorSpec(name = "additiveregression", formalParameters = { "string" })
public class AdditiveRegressionAggregator extends MLAggregator {
private AdditiveRegression model;

public AdditiveRegressionAggregator() {
}

public AdditiveRegressionAggregator(final String s) {
super(s);
}

public void aggregate(String[] data, String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AdditiveRegression");
}

public void aggregate(final Tuple data, final String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AdditiveRegression");
}

@Override
public void aggregate(String data, String metadata) throws IOException, InterruptedException {
}

/**
* {@inheritDoc}
*/
@Override
public void finish() throws IOException, InterruptedException {
try {
this.model = new AdditiveRegression();
this.model.setOptions(options);
this.model.buildClassifier(this.trainingSet);
} catch (Exception e) {
e.printStackTrace();
}
this.saveModel(this.model);
this.evaluate(this.model, this.trainingSet);
this.evaluate(this.model, this.testingSet);
this.collect(this.model.toString());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2014, Hridesh Rajan, Robert Dyer,
* and Iowa State University of Science and Technology
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boa.aggregators.ml;

import boa.runtime.Tuple;
import boa.aggregators.AggregatorSpec;
import weka.classifiers.meta.AttributeSelectedClassifier;

import java.io.IOException;

/**
* A Boa aggregator for training the model using AttributeSelectedClassifier.
*
* @author ankuraga
*/
@AggregatorSpec(name = "attributeselectedclassifier", formalParameters = { "string" })
public class AttributeSelectedClassifierAggregator extends MLAggregator {
private AttributeSelectedClassifier model;

public AttributeSelectedClassifierAggregator() {
}

public AttributeSelectedClassifierAggregator(final String s) {
super(s);
}

public void aggregate(String[] data, final String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AttributeSelectedClassifier");
}

public void aggregate(final Tuple data, final String metadata) throws IOException, InterruptedException {
aggregate(data, metadata, "AttributeSelectedClassifier");
}

@Override
public void aggregate(String data, String metadata) throws IOException, InterruptedException {
}

/**
* {@inheritDoc}
*/
@Override
public void finish() throws IOException, InterruptedException {
try {
this.model = new AttributeSelectedClassifier();
this.model.setOptions(options);
this.model.buildClassifier(this.trainingSet);
} catch (Exception e) {
e.printStackTrace();
}
this.saveModel(this.model);
this.evaluate(this.model, this.trainingSet);
this.evaluate(this.model, this.testingSet);
this.collect(this.model.toString());
}
}
Loading