The following Python code generates a trained model called wine_mdl
:
from sklearn import datasets, svm
import logging
logging.info('Loading a Scikit-learn toy dataset')
wine_df=datasets.load_wine(as_frame=True)
logging.info('Model training')
wine_mdl=svm.SVC(probability=True)
wine_mdl.fit(X=wine_df.data, y=wine_df.target)
# logging.info('Saving the trained model')
I want to run a custom job on Vertex AI Training:
- without managed dataset
- a scikit-learn pre-built container
- a code packaged according to the Google Cloud documentation
- a Google Storage output directory
gs://my-bucket-for-vertexai/my-output-directory
Which line(s) of code could I add to the above Python code to export the trained model to the dedicated Google Storage repository ?
Can you try this? You will need to install Vertex AI SDK for Python:
To upload a model: