CertifaiAI / CertifaiAI/cdle-traininglabs
IndexOutOfBoundsException in PredictGenderTest
- Dominant language
- Java
- Stars
- 41
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
`java.lang.IndexOutOfBoundsException` occurs when user input more than 11 characters (space included) in the input field.
Affected in both solution and training folder.
Code that causes this error:
https://github.com/CertifaiAI/cdle-traininglabs/blob/725a6e4e5bf4f58d3bc73d68bd1cd1a09ba9b817/dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java#L91-L94
**To Reproduce**
Steps to reproduce the behavior:
1. Go to `dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTrain.java`
2. Run the java file to train the model.
3. Go to `dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java`
4. Run the java file and enter the name with more than 11 characters in input field.
**Expected behavior**
No error occurs, successfully predict the gender from the name.
**Screenshots**

**Desktop:**
- OS: Windows 10 Pro
- Version: 10.0.19042 Build 19042
Contributor guide
No contributing guide indexed for this repository
Research direction
Run PredictGenderTrain.java, then reproduce the failure in PredictGenderTest.java with a name longer than 11 characters. Inspect the linked code at lines 91-94 and compare the corresponding solution and training files. Done means both versions accept longer input and successfully predict the gender without an IndexOutOfBoundsException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100