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

RSME argument might be features instead of features[0] #56

Open
mocheng opened this issue May 19, 2023 · 0 comments
Open

RSME argument might be features instead of features[0] #56

mocheng opened this issue May 19, 2023 · 0 comments

Comments

@mocheng
Copy link

mocheng commented May 19, 2023

In the second definition of linear_regressin of this block, it reads

def linear_regression(features, labels, learning_rate=0.01, epochs = 1000):
    price_per_room = random.random()
    base_price = random.random()
    errors = []
    for i in range(epochs):
        predictions = features[0]*price_per_room+base_price
        errors.append(rmse(labels, predictions))
        i = random.randint(0, len(features)-1)

I suppose the predictions should be calculated on all features instead of just the fixed first feature.

        predictions = features[0]*price_per_room+base_price

This makes predictions a scalar instead of a vector. Then, the following rmse makes no sense.

Should it be like this?

        predictions = features*price_per_room+base_price
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

No branches or pull requests

1 participant