UBC-MDS / DSCI_522_Alberta-Oil-Spills

1 stars 2 forks source link

Command line arguments #16

Closed alyciakb closed 5 years ago

alyciakb commented 5 years ago

@huijuechen what are the command line arguments for running scripts 3 and 4? I will add them to the README.

Scripts 1 and 2 command line arguments:

Rscript src/1_data_cleaning.R src/import_data.R data/clean_data.csv
Rscript src/2_data_viz.R data/clean_data.csv img/cause_graph.png cause
Rscript src/2_data_viz.R data/clean_data.csv img/location_graph.png location
Rscript src/2_data_viz.R data/clean_data.csv img/time_of_year_graph.png time
Rscript src/2_data_viz.R data/clean_data.csv img/source_graph.png source
Rscript src/2_data_viz.R data/clean_data.csv img/substance_graph.png substance
Rscript src/2_data_viz.R data/clean_data.csv img/volume_graph.png volume
huijuechen commented 5 years ago

Should be as below:

Scripts 3 and 4 command line arguments:

python src/3_model_fitting.py "./data/clean_data.csv"  "./results/"
python src/4_model_viz.py "./results/" "./results/"
alyciakb commented 5 years ago

When I run script 3, I get the following outputs: cause.csv source.csv location.csv substance.csv

The following files from the code are NOT being created: depth_compare.png finalized_model.sav feature_compare.csv

I think there's an error somewhere in the code for creating the decision tree, due to the following warning popping up in my terminal: Warning: The least populated class in y has only 1 members, which is too few. The minimum number of members in any class cannot be less than n_splits=10.

huijuechen commented 5 years ago

You are right, the issue shud be fixed now. It was caused by the data input, when I was testing the code, after the data was input from the csv, I selected [:,1:] only (eliminating the first row of indexing), but I forgot doing the same when putting in the command line script. So the target set y is no longer the column it should be.