from pycaret.datasets import get_data
data = get_data('juice')
Id | Purchase | WeekofPurchase | StoreID | PriceCH | PriceMM | DiscCH | DiscMM | SpecialCH | SpecialMM | LoyalCH | SalePriceMM | SalePriceCH | PriceDiff | Store7 | PctDiscMM | PctDiscCH | ListPriceDiff | STORE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | CH | 237 | 1 | 1.75 | 1.99 | 0.00 | 0.0 | 0 | 0 | 0.500000 | 1.99 | 1.75 | 0.24 | No | 0.000000 | 0.000000 | 0.24 | 1 |
1 | 2 | CH | 239 | 1 | 1.75 | 1.99 | 0.00 | 0.3 | 0 | 1 | 0.600000 | 1.69 | 1.75 | -0.06 | No | 0.150754 | 0.000000 | 0.24 | 1 |
2 | 3 | CH | 245 | 1 | 1.86 | 2.09 | 0.17 | 0.0 | 0 | 0 | 0.680000 | 2.09 | 1.69 | 0.40 | No | 0.000000 | 0.091398 | 0.23 | 1 |
3 | 4 | MM | 227 | 1 | 1.69 | 1.69 | 0.00 | 0.0 | 0 | 0 | 0.400000 | 1.69 | 1.69 | 0.00 | No | 0.000000 | 0.000000 | 0.00 | 1 |
4 | 5 | CH | 228 | 7 | 1.69 | 1.69 | 0.00 | 0.0 | 0 | 0 | 0.956535 | 1.69 | 1.69 | 0.00 | Yes | 0.000000 | 0.000000 | 0.00 | 0 |
data.drop('Purchase', axis = 1, inplace=True)
data.head()
Id | WeekofPurchase | StoreID | PriceCH | PriceMM | DiscCH | DiscMM | SpecialCH | SpecialMM | LoyalCH | SalePriceMM | SalePriceCH | PriceDiff | Store7 | PctDiscMM | PctDiscCH | ListPriceDiff | STORE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 237 | 1 | 1.75 | 1.99 | 0.00 | 0.0 | 0 | 0 | 0.500000 | 1.99 | 1.75 | 0.24 | No | 0.000000 | 0.000000 | 0.24 | 1 |
1 | 2 | 239 | 1 | 1.75 | 1.99 | 0.00 | 0.3 | 0 | 1 | 0.600000 | 1.69 | 1.75 | -0.06 | No | 0.150754 | 0.000000 | 0.24 | 1 |
2 | 3 | 245 | 1 | 1.86 | 2.09 | 0.17 | 0.0 | 0 | 0 | 0.680000 | 2.09 | 1.69 | 0.40 | No | 0.000000 | 0.091398 | 0.23 | 1 |
3 | 4 | 227 | 1 | 1.69 | 1.69 | 0.00 | 0.0 | 0 | 0 | 0.400000 | 1.69 | 1.69 | 0.00 | No | 0.000000 | 0.000000 | 0.00 | 1 |
4 | 5 | 228 | 7 | 1.69 | 1.69 | 0.00 | 0.0 | 0 | 0 | 0.956535 | 1.69 | 1.69 | 0.00 | Yes | 0.000000 | 0.000000 | 0.00 | 0 |
from pycaret.classification import load_model, predict_model
l = load_model('dsc123', platform = 'aws', authentication = {'bucket' : 'pycaret-test'})
predict_model(l, data=data)
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) <ipython-input-6-64ada9a45af4> in <module> 1 from pycaret.classification import load_model, predict_model ----> 2 l = load_model('dsc123', platform = 'aws', authentication = {'bucket' : 'pycaret-test'}) 3 predict_model(l, data=data) ~\Anaconda3\lib\site-packages\pycaret\classification.py in load_model(model_name, platform, authentication, verbose) 2161 platform=platform, 2162 authentication=authentication, -> 2163 verbose=verbose, 2164 ) 2165 ~\Anaconda3\lib\site-packages\pycaret\internal\tabular.py in load_model(model_name, platform, authentication, verbose) 9013 9014 return pycaret.internal.persistence.load_model( -> 9015 model_name, platform, authentication, verbose 9016 ) 9017 ~\Anaconda3\lib\site-packages\pycaret\internal\persistence.py in load_model(model_name, platform, authentication, verbose) 391 s3.Bucket(bucketname).download_file(key, filename) 392 --> 393 model = load_model(filename, verbose=False) 394 395 if verbose: ~\Anaconda3\lib\site-packages\pycaret\internal\persistence.py in load_model(model_name, platform, authentication, verbose) 371 if verbose: 372 print("Transformation Pipeline and Model Successfully Loaded") --> 373 return joblib.load(model_name) 374 375 # cloud providers ~\Anaconda3\lib\site-packages\joblib\numpy_pickle.py in load(filename, mmap_mode) 575 obj = _unpickle(fobj) 576 else: --> 577 with open(filename, 'rb') as f: 578 with _read_fileobject(f, filename, mmap_mode) as fobj: 579 if isinstance(fobj, str): FileNotFoundError: [Errno 2] No such file or directory: 'dsc123.pkl.pkl'
print(l)