cpalfonso / stellar-data-mining

Scripts to extract subduction-related data for mineral exploration data mining
1 stars 1 forks source link

figure 03-04 feature importance notebook #9

Open RichardScottOZ opened 2 months ago

RichardScottOZ commented 2 months ago
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[7], line 25
     20         classifier_filename = f"pu_classifier_{region}.joblib"
     21     classifier_filename = os.path.join(
     22         outputs_dir,
     23         classifier_filename,
     24     )
---> 25     models[region] = load(classifier_filename)
     27 df_training = pd.read_csv(training_filename)
     28 importances_basename = os.path.join(figures_dir, "Fig-03-feature_importances")

File ~/miniconda3/envs/sdm/lib/python3.12/site-packages/joblib/numpy_pickle.py:650, in load(filename, mmap_mode)
    648         obj = _unpickle(fobj)
    649 else:
--> 650     with open(filename, 'rb') as f:
    651         with _read_fileobject(f, filename, mmap_mode) as fobj:
    652             if isinstance(fobj, str):
    653                 # if the returned file object is a string, this means we
    654                 # try to load a pickle file generated with an version of
    655                 # Joblib so we load it with joblib compatibility function.

FileNotFoundError: [Errno 2] No such file or directory: 'outputs/pu_classifier.joblib'
RichardScottOZ commented 2 months ago

this will follow on to others - and the calculate importance function is looking at a base estimator it seems - but the classifiers saved in the make classifiers part are pipelines