Conversation
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) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Can you make this change in your pull request please? And good initial find by the way!
salmon/model.py
Outdated
| #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) |
There was a problem hiding this comment.
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.
ajboyd2
left a comment
There was a problem hiding this comment.
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
| 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") |
There was a problem hiding this comment.
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.
Added test cases and fixed r_squared function and predict function