save ml model, copy artifacts from branch
Some checks failed
444507-training/pipeline/head There was a failure building this commit

This commit is contained in:
Adam Wojdyla 2022-05-01 18:18:18 +02:00
parent 1b7a420477
commit 886991d7a3
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ pipeline {
stages {
stage('Get arifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's444507-create-dataset', selector: lastSuccessful()
copyArtifacts fingerprintArtifacts: true, projectName: 's444507-create-dataset/master/', selector: lastSuccessful()
}
}
stage('Show stats') {
@ -17,7 +17,7 @@ pipeline {
}
post {
success {
archiveArtifacts artifacts: 'Car_Prices_Poland_Kaggle*, prediction_results.csv', followSymlinks: false
archiveArtifacts artifacts: 'Car_Prices_Poland_Kaggle*, prediction_results.csv, CarPrices_pytorch_model.pkl', followSymlinks: false
}
}
}

View File

@ -109,10 +109,10 @@ print("The accuracy is", accuracy_score(labels_test, np.argmax(pred, axis=1)))
# print(labels_test[0])
print("Saving model to file...")
torch.save(model, "CarPrices_pytorch.pkl")
print("Model saved with name: CarPrices_pytorch.pkl")
torch.save(model, "CarPrices_pytorch_model.pkl")
print("Model saved with name: CarPrices_pytorch_model.pkl")
saved_model = torch.load("CarPrices_pytorch.pkl")
saved_model = torch.load("CarPrices_pytorch_model.pkl")
print(np.argmax(saved_model(x_test[0]).detach().numpy(), axis=0))
pd_predictions = pd.DataFrame(pred)