Arcgis.learn Tabular model: Can't use distance features, can't save model

395
0
07-05-2021 12:51 AM
by Anonymous User
Not applicable

Hi, has anyone experience using prepare_tabulardata() and the save method for fullyconnectednetwork models? I persistently get errors like the one below, trying to save trained models. Same thing happens when trying to include distance features in the analysis, I get this 'KeyError: "Passing list-likes to .loc or [] with any missing labels is no longer supported.' Error.  Am doing smthg wrong, or is there an issue with this particular methods?

 

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
In  [61]:
Line 1:     FCN.save(r'😧\Projects\MyProject30\\MyProject30.gdb\Airbnb_July_21\air', publish=False, gis=None, save_optimizer=False)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_layer_learner.py, in save:
Line 195:   super().save(path, framework, publish, gis, save_optimizer=save_optimizer, **kwargs)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_arcgis_model.py, in save:
Line 1459:  save_optimizer=save_optimizer, save_inference_file=save_inference_file, **kwargs)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_arcgis_model.py, in _save:
Line 1149:  _emd_template = self._create_emd_template(saved_path.with_suffix('.pth'), compute_metrics, save_inference_file)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_arcgis_model.py, in _create_emd_template:
Line 908:   self._model_metrics_cache = self._model_metrics

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_layer_learner.py, in _model_metrics:
Line 203:   score = self.score()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\learn\models\_layer_learner.py, in score:
Line 588:   validation_dataframe = self._data._dataframe.loc[self._data._validation_indexes].reset_index(drop=True)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\indexing.py, in __getitem__:
Line 895:   return self._getitem_axis(maybe_callable, axis=axis)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\indexing.py, in _getitem_axis:
Line 1113:  return self._getitem_iterable(key, axis=axis)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\indexing.py, in _getitem_iterable:
Line 1053:  keyarr, indexer = self._get_listlike_indexer(key, axis, raise_missing=False)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\indexing.py, in _get_listlike_indexer:
Line 1266:  self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\indexing.py, in _validate_read_indexer:
Line 1322:  "Passing list-likes to .loc or [] with any missing labels "

KeyError: "Passing list-likes to .loc or [] with any missing labels is no longer supported. The following labels were missing: Int64Index([6912, 5514, 8785, 2045, 1139,\n            ...\n            3846, 4708, 1646, 7269,  753],\n           dtype='int64', length=169). See https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike...
---------------------------------------------------------------------------

 

Tags (1)
0 Kudos
0 Replies