forked from combust/mleap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from combust/master
Sync with combust master
- Loading branch information
Showing
115 changed files
with
11,063 additions
and
551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,60 @@ | ||
# Use container-based infrastructure | ||
sudo: required | ||
dist: trusty | ||
|
||
services: | ||
- docker | ||
|
||
language: scala | ||
scala: | ||
- 2.11.8 | ||
|
||
python: | ||
- "2.7" | ||
- "3.6" | ||
- "3.7" | ||
|
||
install: | ||
- pip install --user tox | ||
script: | ||
- tox -c python/tox.ini -e $(echo py$TRAVIS_PYTHON_VERSION | tr -d .) -v | ||
- travis/travis.sh | ||
|
||
notifications: | ||
on_success: change | ||
on_failure: always | ||
urls: | ||
- https://webhooks.gitter.im/e/65cd239c75c243ce635e | ||
slack: | ||
rooms: | ||
- secure: "RLxhNQarrr8WNtJRSx855EJX6w9XsyvzfhJGHrJYcNs5hNZfnCcWJaGRExqSHjd3UKpyZOgOAa0+5IrUl4Pbug7Dzq+Kk5nIOxdDILfcL8giVXV2bMfeGADKyiDdkwyeud4eb0Oc7uVhFfmelW8d3EFPWio4yXUaVGZl0cNpCfx9iF1r0vLwRb7U5fiicuvpz8tNZkw6Vp8lrW0+teeXWpzVopxh4gTZxULlaVvp28OIJ09dS2k02baL6g3L4G4z9IxW4adEdH6DpAbw0JgyAFjZE1BXoEQuoZvHjoYstwy62f+maB8c2xNEB9bzobUruc0JHLKly0AdOqtKL25OCeSD3qBVWZKK/TOSQ4phY+iapI1JB5JCoZj/z/k5YogxdRGjFGyUhupuR8+kqZuAUAegD9N5wOLgwei5GTD2oim90ZixeS1Do7GvqhRiyaRHSL0CKRyJXV/iiDr1a8zV5tW8uREZX29Jq5DObxCTLDrWGjqijNWC06lOV0dhvF83qov9A1c+yulrS28qP7Hn7MXQWETShvlw4YxBCDGQLNJ3BMwA9nOx9O0ZI+0KCNVXPu6n8ZVbahJg0LoYZ2ftGFiwxq1/svlhInUN57MXkgI6iDf7NojAL7urGwN3YWbxuJemnASjPtigkN2yboAsBG/aSjOiYNeIVfna//XrFeI=" | ||
- secure: "Afbm/moiSBB7Kn9J9mX4h+ss4cju6WvOBqup0WdkNCUPWKPFs3XRkt8sDZzAyhn7Fu2w4+NclGI/QHhMo8fC+eZG9fhbpPyVoZv1o9e/43qALOB4nXnZGZeGQLdDTFLcx6ylNEK63cQrro5xY7jCwfPYhuakGr9SWkabX6mKqZWThNyH2HPbKQZX540rRwPOxIVgnkhHleCC1vosfgD1brNBt/100cXZXBVjP7GXSJbBDPuKf+cG+bUNET0xxoBK9GurZl8UDhIoo7jfoAj1tY9l0cgzMjxdSO5Yn5Z73DMT3XfiOlT8Hjp+fC37pvssKsfSg72KgTidva71CGwCoJ/B4ly2BtiXNuazzd1vAyCirbJKT8YQwPGihElkaANtMcpWjtnn0v3nTfMvooMT+HRip4kBtfE7Rl+JeVKET0Hhi0Er16eGoCL/XzVuJB7Cfh6B6UJTqHSv3PqeCVP3PQm+qp07VT6KjmMXa2rbMuh5ybs6hQIgZLVc3BeAjGWCZndRxcwgNpG+UvT7Fz87fWOBrN6xZVctXylWatjizf1IXEwBz25X05gMBnafeC3whhX/8jSR3NikwVgY4UQb4mgfSPqXgCeaVQ8VHeLpTM7swVI3q1Vcmms/v7YdPEFGDFLcyYo24GojgBaBZCl7WAk4QxxGrAANqcMpOWXhALo=" | ||
on_success: change | ||
on_failure: always | ||
|
||
jdk: | ||
- oraclejdk8 | ||
cache: | ||
directories: | ||
- $HOME/.ivy2/cache | ||
- $HOME/.sbt/boot/ | ||
before_cache: | ||
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete | ||
- find $HOME/.sbt -name "*.lock" -delete | ||
# Use container-based infrastructure | ||
sudo: required | ||
dist: trusty | ||
|
||
services: | ||
- docker | ||
|
||
language: scala | ||
scala: | ||
- 2.11.8 | ||
jdk: | ||
- oraclejdk8 # sbt +compile fails on jdk11 (xenial's default) | ||
|
||
jobs: | ||
include: | ||
- stage: "Mleap tests" | ||
name: "Scala Tests" | ||
script: | ||
- travis/travis.sh | ||
|
||
- name: "Python 3.6 tests" | ||
language: python | ||
python: 3.6 | ||
install: | ||
- pip install "virtualenv<20.0.0" tox # Bug https://github.com/pypa/virtualenv/issues/1551 | ||
script: | ||
- make py36_test | ||
|
||
- name: "Python 3.7 tests" | ||
language: python # This can't be java and python at the same time | ||
python: 3.7 | ||
env: | ||
# Required when not setting 'language: java' to force the correct jdk8 | ||
- PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//') | ||
- JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64" | ||
dist: xenial # Travis won't install py37 on trusty | ||
install: | ||
- pip install "virtualenv<20.0.0" tox # Bug https://github.com/pypa/virtualenv/issues/1551 | ||
script: | ||
- make py37_test | ||
|
||
notifications: | ||
on_success: change | ||
on_failure: always | ||
urls: | ||
- https://webhooks.gitter.im/e/65cd239c75c243ce635e | ||
slack: | ||
rooms: | ||
- secure: "RLxhNQarrr8WNtJRSx855EJX6w9XsyvzfhJGHrJYcNs5hNZfnCcWJaGRExqSHjd3UKpyZOgOAa0+5IrUl4Pbug7Dzq+Kk5nIOxdDILfcL8giVXV2bMfeGADKyiDdkwyeud4eb0Oc7uVhFfmelW8d3EFPWio4yXUaVGZl0cNpCfx9iF1r0vLwRb7U5fiicuvpz8tNZkw6Vp8lrW0+teeXWpzVopxh4gTZxULlaVvp28OIJ09dS2k02baL6g3L4G4z9IxW4adEdH6DpAbw0JgyAFjZE1BXoEQuoZvHjoYstwy62f+maB8c2xNEB9bzobUruc0JHLKly0AdOqtKL25OCeSD3qBVWZKK/TOSQ4phY+iapI1JB5JCoZj/z/k5YogxdRGjFGyUhupuR8+kqZuAUAegD9N5wOLgwei5GTD2oim90ZixeS1Do7GvqhRiyaRHSL0CKRyJXV/iiDr1a8zV5tW8uREZX29Jq5DObxCTLDrWGjqijNWC06lOV0dhvF83qov9A1c+yulrS28qP7Hn7MXQWETShvlw4YxBCDGQLNJ3BMwA9nOx9O0ZI+0KCNVXPu6n8ZVbahJg0LoYZ2ftGFiwxq1/svlhInUN57MXkgI6iDf7NojAL7urGwN3YWbxuJemnASjPtigkN2yboAsBG/aSjOiYNeIVfna//XrFeI=" | ||
- secure: "Afbm/moiSBB7Kn9J9mX4h+ss4cju6WvOBqup0WdkNCUPWKPFs3XRkt8sDZzAyhn7Fu2w4+NclGI/QHhMo8fC+eZG9fhbpPyVoZv1o9e/43qALOB4nXnZGZeGQLdDTFLcx6ylNEK63cQrro5xY7jCwfPYhuakGr9SWkabX6mKqZWThNyH2HPbKQZX540rRwPOxIVgnkhHleCC1vosfgD1brNBt/100cXZXBVjP7GXSJbBDPuKf+cG+bUNET0xxoBK9GurZl8UDhIoo7jfoAj1tY9l0cgzMjxdSO5Yn5Z73DMT3XfiOlT8Hjp+fC37pvssKsfSg72KgTidva71CGwCoJ/B4ly2BtiXNuazzd1vAyCirbJKT8YQwPGihElkaANtMcpWjtnn0v3nTfMvooMT+HRip4kBtfE7Rl+JeVKET0Hhi0Er16eGoCL/XzVuJB7Cfh6B6UJTqHSv3PqeCVP3PQm+qp07VT6KjmMXa2rbMuh5ybs6hQIgZLVc3BeAjGWCZndRxcwgNpG+UvT7Fz87fWOBrN6xZVctXylWatjizf1IXEwBz25X05gMBnafeC3whhX/8jSR3NikwVgY4UQb4mgfSPqXgCeaVQ8VHeLpTM7swVI3q1Vcmms/v7YdPEFGDFLcyYo24GojgBaBZCl7WAk4QxxGrAANqcMpOWXhALo=" | ||
on_success: change | ||
on_failure: always | ||
|
||
cache: | ||
directories: | ||
- $HOME/.ivy2/cache | ||
- $HOME/.sbt/boot/ | ||
before_cache: | ||
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete | ||
- find $HOME/.sbt -name "*.lock" -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SHELL := /bin/bash | ||
|
||
.PHONY: py36_test py37_test | ||
|
||
py36_test: | ||
source scripts/scala_classpath_for_python.sh && make -C python py36_test | ||
|
||
py37_test: | ||
source scripts/scala_classpath_for_python.sh && make -C python py37_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
...main/scala/ml/combust/mleap/core/classification/MultiLayerPerceptronClassifierModel.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
mleap-core/src/main/scala/ml/combust/mleap/core/feature/HandleInvalid.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ml.combust.mleap.core.feature | ||
|
||
sealed trait HandleInvalid { | ||
def asParamString: String | ||
} | ||
|
||
object HandleInvalid { | ||
val default = Error | ||
|
||
case object Error extends HandleInvalid { | ||
override def asParamString: String = "error" | ||
} | ||
|
||
case object Skip extends HandleInvalid { | ||
override def asParamString: String = "skip" | ||
} | ||
|
||
case object Keep extends HandleInvalid { | ||
override def asParamString: String = "keep" | ||
} | ||
|
||
def fromString(value: String, canSkip: Boolean = true): HandleInvalid = value match { | ||
case "error" => HandleInvalid.Error | ||
case "skip" => if (canSkip) HandleInvalid.Skip else throw new IllegalArgumentException(s"Invalid handler: $value") | ||
case "keep" => HandleInvalid.Keep | ||
case _ => throw new IllegalArgumentException(s"Invalid handler: $value") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.