Skip to content

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

Open
@mocheng

Description

@mocheng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions