GithubHelp home page GithubHelp logo

a-2017's Introduction

cs109a-fall2017

This is the public folder to CS109a course material

The canvas link for this course is https://canvas.harvard.edu/courses/29726

For students not having access to canvas as yet, HW 0 is cs109a_hw0.ipynb in this folder. The due date is Sep 8th, 11:59PM. Registered students should upload both a notebook and a pdf produced from the notebook (use the browser print function) to canvas. Students who are not yet registered, such as MIT students, should email [email protected] with these two files attached.

The Lab and Lecture material can be accessed from the respective folders.

a-2017's People

Contributors

albertw1 avatar csiviy avatar elangelaki avatar elenikaxiras avatar kratur avatar margolevine avatar nathanielburbank avatar nickhoernle avatar nickruta avatar ohiomoba avatar onefishy avatar pavlosprotopapas avatar rahuldave avatar won1k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a-2017's Issues

PolynomialFeatures constructor is called with the wrong degree

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.

Standardization of test data in Lab 6 should use training mean and standard deviation

Observed behavior

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:

  • No information from the testing data should be used in the model prediction as it is a form of data snooping. The testing dataset has been contaminated by this.
  • The same variable is not being created during the transformation of the training and testing sets

Expected behavior

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:

Simpler models should be selected in Forward/Backward Selection in Lecture_6_Notebook.ipynb

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.

  1. Forward Selection code should read:
best_predictor_set = sorted(predictors, key=lambda t: t[1], reverse=True)[0]
  1. Backward Selection code should read:
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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.