Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

load saved model pyspark

print(spark.version)
2.4.3

# fit model
cvModel = cv_grid.fit(train_df)

# save best model to specified path
mPath =  "/path/to/model/folder"
cvModel.bestModel.write().overwrite().save(mPath)

# read pickled model via pipeline api
from pyspark.ml.pipeline import PipelineModel
persistedModel = PipelineModel.load(mPath)

# predict
predictionsDF = persistedModel.transform(test_df)
Comment

PREVIOUS NEXT
Code Example
Python :: acess nvidia from docker compose 
Python :: python check if list contains elements of another list 
Python :: use beautifulsoup 
Python :: find index of null values pandas 
Python :: multipl excel sheets in pandas 
Python :: how to find where python is located 
Python :: django select database for migrate 
Python :: python get all file names in a dir 
Python :: insta profile downloader in python 
Python :: django admin slug auto populate 
Python :: check odd numbers numpy 
Python :: check package version jupyter python 
Python :: pandas read csv without header 
Python :: trim text python 
Python :: print time python 
Python :: opening image in python 
Python :: flask post 
Python :: python nCr n choose r function 
Python :: open a web page using selenium python 
Python :: django jinja subset string 
Python :: opencv flip image 
Python :: no module named pyplot 
Python :: get output of ps aux grep python 
Python :: wait for input python 
Python :: pandas columns add prefix 
Python :: boston data set to pandas df 
Python :: python get num classes from label encoder 
Python :: SerialClient.py", line 41, in <module import queue ImportError: No module named queue 
Python :: Check for duplicate values in dataframe 
Python :: python scatter plot 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =