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

Dependency Problems from Email #236

Open
whitead opened this issue Feb 21, 2023 · 0 comments
Open

Dependency Problems from Email #236

whitead opened this issue Feb 21, 2023 · 0 comments

Comments

@whitead
Copy link
Owner

whitead commented Feb 21, 2023

  1. Dependencies - in all my trials, the code wouldn't work with late versions of pillow. I use:

"pillow==8.3.2"

instead of

"pillow>=8.3.2"

This isn't optimal but so far it works as long as I don't need to paste equations on Colab.

  1. Under 3.8.1:

Leave one class out CV

N = len(soldata)
error = []
error_std = []
for c in unique_classes:
# slice out segments
test = soldata.loc[soldata["Group"] == c]
train = soldata.loc[soldata["Group"] != c]
test_x, test_y = test[feature_names].values, test["Solubility"].values
x, y = train[feature_names].values, train["Solubility"].values
# compute coefficients
w, *_ = np.linalg.lstsq(x, y)
# compute intercept (b)
b = np.mean(y - np.dot(x, w))
# compute test erropr
k_error.append(np.mean((np.dot(test_x, w) + b - test_y) ** 2))
error.append(np.mean(k_error))
error_std.append(np.std(k_error, ddof=1))
print(f"test error = {np.mean(error):.2f}")

There is something missing as k_error isn't initiated

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