We are now ready to build the deep learning pipeline for training our dataset.
The following libraries will be imported to assist with the pipeline development:
LogisticRegression
Pipeline
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...