mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
MAINT: Updated f-string method (#6230)
* MAINT: Used f-string method Updated the code with f-string methods wherever required for a better and cleaner understanding of the code. * Updated files with f-string method * Update rsa_key_generator.py * Update rsa_key_generator.py * Update elgamal_key_generator.py * Update lru_cache.py I don't think this change is efficient but it might tackle the error as the error was due to using long character lines. * Update lru_cache.py * Update lru_cache.py Co-authored-by: cyai <seriesscar@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -47,9 +47,9 @@ def main():
|
||||
y_pred = model.predict(X_test)
|
||||
|
||||
# The mean squared error
|
||||
print("Mean squared error: %.2f" % mean_squared_error(y_test, y_pred))
|
||||
print(f"Mean squared error: {mean_squared_error(y_test, y_pred):.2f}")
|
||||
# Explained variance score: 1 is perfect prediction
|
||||
print("Test Variance score: %.2f" % r2_score(y_test, y_pred))
|
||||
print(f"Test Variance score: {r2_score(y_test, y_pred):.2f}")
|
||||
|
||||
# So let's run the model against the test data
|
||||
fig, ax = plt.subplots()
|
||||
|
Reference in New Issue
Block a user