Created
October 9, 2020 07:08
-
-
Save StevenReitsma/c979aacc4148f59199f9c8ec742e15a6 to your computer and use it in GitHub Desktop.
Vantage Training
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import datasets | |
from sklearn import svm | |
import joblib | |
def train(data): | |
clf = svm.SVC(gamma=0.001, C=100.) | |
clf.fit(data.data[:-1], data.target[:-1]) | |
return clf | |
def load_data(): | |
return datasets.load_digits() | |
def save_model(model): | |
joblib.dump(model, os.path.join(os.environ["MODEL_PATH"], "saved_model.pkl")) | |
if __name__ == "__main__": | |
print("Loading data...") | |
data = load_data() | |
print("Training model...") | |
model = train(data) | |
print("Saving model...") | |
save_model(model) | |
print("All done!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment