Creating a pipeline for image classification training
We are now ready to build the deep learning pipeline for training our dataset.
Getting ready
The following libraries will be imported to assist with the pipeline development:
LogisticRegression
Pipeline
How to do it...
The following section walks through the following steps for creating a pipeline for image classification:
- Execute the following script to begin the deep learning pipeline as well as to configure the classification parameters:
from pyspark.ml.classification import LogisticRegression from pyspark.ml import Pipeline vectorizer = dl.DeepImageFeaturizer(inputCol="image", outputCol="features", modelName="InceptionV3") logreg = LogisticRegression(maxIter=30, labelCol="label") pipeline = Pipeline(stages=[vectorizer, logreg]) pipeline_model = pipeline.fit(trainDF)
- Create a new dataframe,
predictDF
, that houses the original testing labels as well as the new prediction scores...