cognoma / frontend

Frontend for Project Cognoma
http://cognoma.org/
Other
4 stars 22 forks source link

ValueError: The number of class labels must be greater than one. #127

Closed Miserlou closed 6 years ago

Miserlou commented 6 years ago

This was my result from our tour of Cognoma session today.

An error has occurred and your classifier could not be processed.
Error: An error occurred while executing the following cell:
------------------
# Fit the models
for model, pipeline in cv_pipelines.items():
    print('Fitting CV for model: {0}'.format(model))
    start_time = time.perf_counter()
    pipeline.fit(X=X_train, y=y_train)
    end_time = time.perf_counter()
    elapsed = datetime.timedelta(seconds=end_time - start_time)
    print('\truntime: {}'.format(elapsed))
------------------

ValueError: The number of class labels must be greater than one.
Support is available at https://github.com/cognoma.

I think to reproduce this, you can choose the first item in each list when searching for the letter 'T'.

It looks like this is a type of bad input which could be prevented from executing by checking something on the front end.

rdvelazquez commented 6 years ago

This probably happened because the query you submitted didn't have any mutated (positive) samples. You will get other similar errors if you submit a query that only has a few mutated samples. We addressed this issue by not allowing queries with less than 20 negative (or positive) samples. These changes were pushed in #104 but haven't been deployed yet. Once the changes are deployed you will get a pop-up message when you try to submit a query that doesn't have enough positive samples.

Hopefully this answers your question... you can try another query and just make sure the query has at least 20 positive and negative samples. Let me know if you have any questions. Glad to see Cognoma getting some use!

ramenhog commented 6 years ago

This definitely seems fixed in the master branch. Closing.