Python Collab - Calling Data Processing Functions

Firstly want to say how impressed I am with the whole set up, as someone who is new to python, machine learning I have found this whole process a fantastic way to learn.

I am having an issue with using my data processing functions.

I define them in the step ‘Define your data preprocessing’ and I then call them in the fit_model function.

However when I run trained_model = fit_model(X_train, y_train) I get the error that my data processing fucntions are undefined.

Anyone able to help?


Thanks for the kind words @robstef! This is all due to the magic of the AIcrowd team (namely @jyotish).

Is this error occurring:

  1. Within the colab notebooks? or
  2. After submission as an output on AIcrowd?

If (1), could you please go to runtime and click restart and run all and then give me the resulting AIcrowd submission number? And if (2), could you please just point me to your submission number?

Thanks for the swift reply!

It happens in 1. Within the colab notebooks.

To restart and run all i needed to comment out code that calls the data processing, you can see it under #Data Processing in the fit_model block.

Submission #111324

Thanks @robstef

So looking through your submission I can see there are two issues:

  1. The package lightgbm is an APT package rather so it needs to be installed in a slightly different way. See this post on what to include in your config in the notebook.
  2. There is a small error in the definition of your proc_x function. Namely you should have df_add = df_raw rather than the other way around. Also in the last line you should have df_add.drop( ..., inplace=True). See the pandas documentation for more.

Then in your fit_model you should include a line such as x_proc = proc_x(X_raw).

If these don’t resolve your issue let me know and we will dig further :slight_smile:


Appreciate the quick and detailed response.

It’s working now!

Kind Regards,

1 Like