cs109 / a-2017 Goto Github PK
View Code? Open in Web Editor NEWPublic Repository for cs109a, 2017 edition
Home Page: http://cs109.github.io/a-2017
Public Repository for cs109a, 2017 edition
Home Page: http://cs109.github.io/a-2017
I've spotted two small bugs in Lecture_6_Notebook.ipynb in the Forward Selection
and Backward Selection
code. There are 3 models in both cases where the feature sets in have exactly the same value of R squared
and AIC
respectively.
In both cases, the model with the the largest number of features is selected. Really, in accordance with Occam's razor, we should favor the simplest model and select the model with the smallest number of features.
best_predictor_set = sorted(predictors, key=lambda t: t[1], reverse=True)[0]
best_predictor_set = sorted(predictors, key=lambda t: t[1], reverse=True)[-1]
PS: I would have submitted a pull request, but wasn't sure you would want it as the output in the notebook would change.
There is a copy-paste typo in the last cell of the Lecture_6_Notebook.ipynb. The value of k is being chosen, not the degree of the polynomial. It instead should read something like:
print('the test R^2 for a {} knn model is: {}'.format(best_k, test_R_sq))
PS: I didn't submit a pull request as you probably don't want the output from my notebook.
Hi, there are bugs in classification-and-pca-lab.ipynb for Lab 6
in the do_classify
and classify_from_dataframe
methods. When standardizing the testing data, its mean and standard deviation are used. This is incorrect for several reasons such as:
The training data mean and standard deviation should be used for standardizing the testing data like so:
dftest=(subdf.iloc[itest] - subdf.iloc[itrain].mean())/subdf.iloc[itrain].std()
Xte = (subdf.iloc[itest] - subdf.iloc[itrain].mean())/subdf.iloc[itrain].std()
I think this was mentioned in one of the earlier lectures and here are some more references:
I have seen a bug in the section Cross Validation: For Selecting Polynomial Model Degree
of Lecture_6_Notebook.ipynb. The degree d
is incorrectly used in the PolynomialFeatures
constructor. This has a value of 19 which is the last index of the previous loop. The intention is to use the degree with the best cross-validation score so the code should read:
gen_poly_terms = PolynomialFeatures(degree=best_degree, interaction_only=False)
PS: Likewise, I have not submitted a pull request for this as you may not want the output produced from my notebook.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.