Skip to content

Comments

Salmon test#14

Open
bmangels12 wants to merge 13 commits intoajboyd2:masterfrom
bmangels12:salmon_test
Open

Salmon test#14
bmangels12 wants to merge 13 commits intoajboyd2:masterfrom
bmangels12:salmon_test

Conversation

@bmangels12
Copy link
Collaborator

Added test cases and fixed r_squared function and predict function

salmon/model.py Outdated
numerator = sse / (len(y) - len(self.X_train_.columns) - 2)
denominator = ssto / (len(y) - 1)
numerator = sse / (len(y) - len(self.X_train_.columns) - 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked this code. The way the model is setup, this actually needs to be:
numerator = sse / (len(y) - len(model.coef_) - 1)

This is because we do special things for the intercept and so it isn't always counted properly via len(self.X_train_.columns).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this change in your pull request please? And good initial find by the way!

salmon/model.py Outdated
Comment on lines 395 to 398
#W_crit_squared = p * stats.f.ppf(1 - (alpha / 2), p, self.rdf)
# print(W_crit_squared)
# print(p)
#return (W_crit_squared ** 0.5) * (s_yhat_squared ** 0.5)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine these were taken out because they didn't match the output from R? It's a special kind of confidence interval that accounts for multiple comparisons. We should probably keep it the way that you wrote in your commit though.

Just be sure to take out the commented code.

Copy link
Owner

@ajboyd2 ajboyd2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some comments in the model.py file. Once those are addressed we should be good to go to add these changes in!

salmon/test.py Outdated
Comment on lines 219 to 221
commprop = pd.read_csv("https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/CommProp.csv")
plastic = pd.read_csv("https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/Plastic.csv")
realestate = pd.read_csv("https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/Real Estate5.csv")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in our emails, please change these from url references to point to the data/ directory. If you could download the iris dataset and add it to the data/ directory and make the change to line 218 that would be appreciated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants