Skip to main content

I want to try root cause analysis in ML on my data.

I have followed the same way as here https://celonis.github.io/pycelonis/notebooks/01_Root_Cause_Analysis_Tutorial.html.

All steps work fine until it reachs  the row

rca_result = RCA.apply()

The reported bug says this : UnboundLocalError: local variable 'za' referenced before assignment

Details listed below:

0it <00:00, ?it/s]

---------------------------------------------------------------------------

UnboundLocalError Traceback (most recent call last)

/tmp/ipykernel_740/325769791.py in <module>

----> 1 rca_result = RCA.apply()

~/.local/lib/python3.8/site-packages/pycelonis/root_cause_analysis/root_cause_analysis.py in apply(self)

60 selected_tables, search_list = self.filter_case_key()

61 chunks = self.create_chunk_list(selected_tables, search_list)

---> 62 za = self.calculate_kpis(chunks)

63 zb = self.postprocess_kpi_frame(za)

64 return zb

~/.local/lib/python3.8/site-packages/pycelonis/root_cause_analysis/root_cause_analysis.py in calculate_kpis(self, chunks)

268

269 # sort columns

--> 270 za = za za.columns.sort_values()]

271 # drop categories that are 100 % equal (i.e. duplicated)

272 za = za.drop_duplicates(subset=za.columns=za.columns.str.contains("Amount of")].tolist(), keep="first")

UnboundLocalError: local variable 'za' referenced before assignment

I think the linked tutorial has missed some steps. Can you provide me a full souce for root cause analysis?

Thanks very much.

  • could you also provide some examples on the usage of parameter celonis_filter : str/list

Filter string or list of filter strings used if you want to limit the search to e.g. a specific plant.

  • how to achieve the effect of choosing tables and dimensions for Root cause analysis in pycelonis like in Process Analytics?

 

Regards

Kefang

 

 

 


Reply