Advertisement
sissou123

Untitled

Oct 11th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | Source Code | 0 0
  1.  
  2.  We are using Python 3.11-slim in our case.
  3. Step-by-Step Guide to Deploying ML Models with Docker
  4.  
  5. Let’s walk through how to deploy a machine-learning model using Docker.
  6.  model.py:
  7.  
  8.  
  9. from sklearn.datasets import load_iris
  10. from sklearn.ensemble import RandomForestClassifier
  11. import pickle
  12.  
  13.  
  14. # Train and save the model
  15. def train_model():
  16.     # Load dataset
  17.     data = load_iris()
  18.     X, y = data.data, data.target
  19.    
  20.     # Train model
  21.     model = RandomForestClassifier()
  22.     model.fit(X, y)
  23. for more:https://cuty.io/Lkw5k1
  24.  
  25.  
  26.  
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement