Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intercept to x arrays in solution to part d) of problem 3 of Problem Set 1 #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lorenzorossi7
Copy link

Take the file problem-sets-solutions/PS1/code/src/p03d_poisson.py. This contains the solution to part d) of problem 3 of Problem Set 1.

An intercept should be added when the training set and validation set are loaded. To do so, I replaced the line
x_train, y_train = util.load_dataset(train_path, add_intercept=False)
with
x_train, y_train = util.load_dataset(train_path, add_intercept=True)

and replaced the line
x_eval, y_eval = util.load_dataset(eval_path, add_intercept=False)
with
x_eval, y_eval = util.load_dataset(eval_path, add_intercept=True)

lorenzorossi7 and others added 5 commits October 19, 2024 16:21
…ed to input features x for training and validation set.
Add intercept to x arrays in solution to part d) of problem 3 of Problem Set 1
…sv set as test set, instead of the proper ds5_test.csv set.

Corrected this by replacing line
test_x, test_y = util.load_csv('data/ds5_train.csv')
with line
test_x, test_y = util.load_csv('data/ds5_test.csv')
@lorenzorossi7
Copy link
Author

One more bug fix.
The function train_perceptron used to load the ds5_train.csv set as test set, instead of the proper ds5_test.csv set.

I have corrected this by replacing line
test_x, test_y = util.load_csv('data/ds5_train.csv')
with line
test_x, test_y = util.load_csv('data/ds5_test.csv')

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.

1 participant