[
https://issues.apache.org/jira/browse/MAHOUT-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547708#comment-16547708
]
ASF GitHub Bot commented on MAHOUT-2051:
----------------------------------------
GitHub user pschaumann opened a pull request:
https://github.com/apache/mahout/pull/357
MAHOUT-2051 [WIP] Fix IllegalStateException in MixedGradient.java
### Purpose of PR:
After initialization of a MixedGradient instance both variables "hasZero"
and "hasOne" are false, which leads to an IllegalStateException in the function
"apply" if random.nextDouble() < alpha.
The proposed change would avoid this by using only the base gradient until
both cases (actual == 0 and actual == 1) occured at least once.
### Important ToDos
Please mark each with an "x"
- [x] A JIRA ticket exists (if not, please create this
first)[https://issues.apache.org/jira/browse/ZEPPELIN/]
- [x] Title of PR is "MAHOUT-XXXX Brief Description of Changes" where XXXX
is the JIRA number.
- [ ] Created unit tests where appropriate
- [x] Added licenses correct on newly added files
- [ ] Assigned JIRA to self
- [ ] Added documentation in scala docs/java docs, and to website
- [x] Successfully built and ran all unit tests, verified that all tests
pass locally.
If all of these things aren't complete, but you still feel it is
appropriate to open a PR, please add [WIP] after MAHOUT-XXXX before the
descriptions- e.g. "MAHOUT-XXXX [WIP] Description of Change"
Does this change break earlier versions?
No
Is this the beginning of a larger project for which a feature branch should
be made?
No
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/pschaumann/mahout patch-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/mahout/pull/357.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #357
----
commit e317713975b97169b8004126808dbb7696609372
Author: pschaum <41364203+pschaum@...>
Date: 2018-07-18T09:50:30Z
Fix IllegalStateException in MixedGradient.java
After initialization of a MixedGradient both "hasZero" and "hasOne" are
false, which leads to an IllegalStateException in the function "apply" if
random.nextDouble() < alpha.
The proposed change would avoid this by using only the base gradient until
both cases (actual == 0 and actual == 1) occured at least once.
----
> MixedGradient throws a random IllegalStateException
> ---------------------------------------------------
>
> Key: MAHOUT-2051
> URL: https://issues.apache.org/jira/browse/MAHOUT-2051
> Project: Mahout
> Issue Type: Bug
> Components: Classification
> Affects Versions: 1.0.0, 0.12.0, 0.11.2, 0.12.1, 0.13.0, 0.12.2, 0.14.0,
> 0.13.1, 0.13.2
> Reporter: Peter Schaumann
> Priority: Minor
> Fix For: 1.0.0, 0.12.0, 0.11.2, 0.12.1, 0.13.0, 0.12.2, 0.14.0,
> 0.13.1, 0.13.2
>
>
> The function _apply_ in the class _MixedGradient_ throws an exception when
> both variables _hasZero_ and _hasOne_ are _false_. In order for both of them
> to be _true_, the RNG has to pick the basic gradient until both are set to
> _true,_ otherwise _an IllegalStateException_ is thrown.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)