Dec-08-2017, 02:29 PM
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
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