Skip to content
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

input data with samples from just one class #1

Open
Mohammad-Bakhtiari opened this issue Aug 31, 2021 · 0 comments
Open

input data with samples from just one class #1

Mohammad-Bakhtiari opened this issue Aug 31, 2021 · 0 comments

Comments

@Mohammad-Bakhtiari
Copy link

When in the input data there are samples of one class(in a binary classification data), the app fails.

Config.yml:

fc_random_forest: input: train: "data.csv" test: "data.csv" output: pred: "pred.csv" proba: "proba.csv" test: "test.csv" format: sep: "," label: "10" split: mode: file # directory if cross validation was used before, else file dir: . # data if cross validation app was used before, else . estimators: 100 # number of trees in the forest mode: classification # classification or regression random_state: 42 # random state for reproducibility

logs:

`2021-08-31 15:44:16,406 CRIT Supervisor running as root (no user in config file)
2021-08-31 15:44:16,407 INFO supervisord started with pid 8
2021-08-31 15:44:17,411 INFO spawned: 'nginx' with pid 11
2021-08-31 15:44:17,415 INFO spawned: 'app' with pid 12
Starting app
Bottle v0.12.19 server starting up (using WSGIRefServer())...
Listening on http://localhost:5000/
Hit Ctrl-C to quit.

2021-08-31 15:44:19,356 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-08-31 15:44:19,357 INFO success: app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[CTRL] POST /setup
Received setup: 0 True ['0']
Reading input...
127.0.0.1 - - [31/Aug/2021 15:44:21] "POST /api/setup HTTP/1.0" 200 0
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:21] "GET /api/status HTTP/1.0" 200 39
Read input. Have [165] samples.
Calculate local values...
Trained random forests
Forest done
Writing output
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/app/app/logic.py", line 258, in app_flow
write_output(os.path.join(base_dir_out, self.output_proba), {'prob_0': results_proba[0][:, 0], 'prob_1': results_proba[0][:, 1]})
IndexError: index 1 is out of bounds for axis 1 with size 1

[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:26] "GET /api/status HTTP/1.0" 200 38
[CTRL] GET /data
Submit data
127.0.0.1 - - [31/Aug/2021 15:44:26] "GET /api/data HTTP/1.0" 200 49977
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:31] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:36] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:41] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:46] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:51] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:44:56] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:01] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:06] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:11] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:16] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:21] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:26] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:31] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:36] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:41] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:46] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:51] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:45:56] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:01] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:06] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:11] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:16] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:21] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:26] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:31] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:36] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:41] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:46] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:51] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:46:56] "GET /api/status HTTP/1.0" 200 39
[CTRL] GET /status
127.0.0.1 - - [31/Aug/2021 15:47:01] "GET /api/status HTTP/1.0" 200 39`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant