'LogisticRegression' object has no attribute 'classes_'
Dovakin94 opened this issue · comments
@Dovakin94 I was able to reproduce your issue on a Windows system, yet the problem is more broad since it was missing documentation. I updated the notes for developers and that should fix your pipeline commands.
Hi @emmanvg ,
Had to open this after more than a year.
I ran into the same issue. I may have missed the part of the updated notes that should fix the pipeline commands. I'm developing on WSL.
@Dovakin94 , was your issue resolved a year ago? If it did, how did you resolve it?
I also feel that the documentation is slightly lacking between step 11 and step 12.
11. Open the application in your web browser.
1. Navigate to <http://localhost:8000> and use the superuser to log in
12. In a separate terminal window, run the ML pipeline
```sh
cd tram/
source venv/bin/activate
tram pipeline run
```
I am not sure what the pipeline is running.
Are we suppose to upload an article into the web UI before we run the pipeline?
Cheers!
Hi @wei-ann-Github, I think the cause is that it cannot load serialized models from disk. Did you run these commands during set up?
tram attackdata load
tram pipeline load-training-data
tram pipeline train --model nb
tram pipeline train --model logreg
tram pipeline train --model nn_cls
After training you should see some serialized models saved to disk. Can you run this next command and tell me if you see these .pkl files?
$ ls -lah data/ml-models
total 12776
drwxr-xr-x 7 mhaase staff 224B May 6 2022 ./
drwxr-xr-x 11 mhaase staff 352B Oct 7 2022 ../
-rw-r--r-- 1 mhaase staff 0B May 6 2022 .gitkeep
-rw-r--r-- 1 mhaase staff 12K Oct 7 2022 DummyModel.pkl
-rw-r--r-- 1 mhaase staff 917K May 5 2022 LogisticRegressionModel.pkl
-rw-r--r-- 1 mhaase staff 3.7M Mar 1 2022 MLPClassifierModel.pkl
-rw-r--r-- 1 mhaase staff 1.6M Mar 1 2022 NaiveBayesModel.pkl
That should help us figure out what the root cause is.
I am not sure what the pipeline is running.
Are we suppose to upload an article into the web UI before we run the pipeline?
The tram pipeline run
command is an infinite loop that checks for new reports and submits them for labeling. So you need to run that command and then upload articles in the web UI. After uploading, wait a few seconds and then the report should be analyzed and the results are visible in the web UI.
Thank you @mehaase , tram pipeline run
did not run in an infinite loop for me. I have attached what I see in my terminal here:
Hi @wei-ann-Github, my previous comment was inaccurate. You are correct, tram pipeline run
runs any jobs that are currently queued, and then it quits. You can run tram pipeline run --run-forever
to make put it an infinite loop.
The output you are seeing suggests that there are no reports in the queue. Click the upload report button and upload a document (e.g. PDF format). It should show queued status.
![Screenshot 2023-07-26 at 9 32 09 AM](https://private-user-images.githubusercontent.com/320904/256247479-41e090ab-6c77-4ec7-b520-443266886256.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1MzI4MDYsIm5iZiI6MTcyMTUzMjUwNiwicGF0aCI6Ii8zMjA5MDQvMjU2MjQ3NDc5LTQxZTA5MGFiLTZjNzctNGVjNy1iNTIwLTQ0MzI2Njg4NjI1Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyMVQwMzI4MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMGI5YzdhNWEzYTM0ZjQ4YmQzOTJmYWViOWU2MTQyZTg4ZDM1YzdkODZjYTBiMWM5MjkyYWQ0ZTg3MzkwNjhhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.j8yfTU6Y6A6iUYGEJm4sadEnbugWBckuO2ewmRXZk9Q)
Once you see queued status, you can run the pipeline to process that report. When processing is complete, refresh the UI and click "Analyze" to see the results. If you are still having problems after this, please open a new issue.