gtolomei commented on issue #14456:
URL: https://github.com/apache/spark/pull/14456#issuecomment-618493192
Thanks for your reply Sean!
My setting is as follows: I'm running PySpark 2.4.5 remotely over Google
Colab.
As per the way in which I print out the result, I'm using the following
function:
```
def summarize_all_models(cv_models):
for k, models in enumerate(cv_models):
print("*************** Fold #{:d} ***************\n".format(k+1))
for i, m in enumerate(models):
print("--- Model #{:d} out of {:d} ---".format(i+1, len(models)))
print("\tParameters: lambda=[{:.3f}]; alpha=[{:.3f}]
".format(m.stages[-1]._java_obj.getRegParam(),
m.stages[-1]._java_obj.getElasticNetParam()))
print("\tRMSE:
{:.3f}\n".format(m.stages[-1].summary.rootMeanSquaredError))
print("***************************************\n")
```
I call the above function as follows:
```
summarize_all_models(cv_model.subModels)
```
where `cv_model` is the result returning from the k-fold cross validation.
Thanks again for your help!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]