Python Forum
Coursera: Where are complete source code examples?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coursera: Where are complete source code examples?
#1
Has anyone tried the Coursera.org class on python machine learning?

They have an example in their "notebook", but their notebooks have a snippet approach. I can't find a complete code example and their code in the class assumes certain variables are there.

https://www.coursera.org/learn/python-ma...regression

What's totally unclear is how they load the X_train and y_train in their working example at about time index 8:55.

The code imports a crime dataset from an included text file and also uses a "load_crime_dataset()" method/function in a helper py file called "adspy_shared_utilities.py". That load_crime_dataset() method returns two values:

1. X_crime = crime.ix[:,range(0,88)]
2. y_crime = crime['ViolentCrimesPerPop']

But, since this helper code is not documented, it's unclear if these translate to X_Train and y_train per the courses's powerpoint slide.

Making the assumption that the code is correct, and running it, gives this error:

ValueError: Found input variables with inconsistent numbers of samples: [499, 1495]

There doesn't seem to be any way for an "auditor" (that is, non-paying participant) of the course to get help. I've downloaded all the sample files, but no complete examples seem to exist with context.

Suggestions?

-- O
Reply


Messages In This Thread
Coursera: Where are complete source code examples? - by Oliver - Dec-08-2017, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What is the best comment in source code you have ever encountered? buran 1 4,697 Mar-04-2020, 10:34 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020