Skip to content

Commit

Permalink
fix vulture
Browse files Browse the repository at this point in the history
  • Loading branch information
julienfoenet committed Oct 7, 2024
1 parent 4abd4e9 commit a57b85d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Run Linter
run: python -m flake8
- name: Run Vulture
run: "Trainee should add command to run vulture"
run: python -m vulture
- name: Run tests
run: "Trainee should add command to run test"

Expand Down
10 changes: 0 additions & 10 deletions formation_indus_ds_avancee/train_and_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ def train_model(features: pd.DataFrame, model_registry_folder: str) -> None:
joblib.dump(model, os.path.join(model_registry_folder, 'model.joblib'))


def predict_with_io(features_path: str, model_path: str, predictions_folder: str) -> None:
features = pd.read_parquet(features_path)
features = predict(features, model_path)
time_str = time.strftime('%Y%m%d-%H%M%S')
features['predictions_time'] = time_str
features[['predictions', 'predictions_time']].to_csv(os.path.join(predictions_folder, time_str + '.csv'),
index=False)
features[['predictions', 'predictions_time']].to_csv(os.path.join(predictions_folder, 'latest.csv'), index=False)


def predict(features: pd.DataFrame, model_path: str) -> pd.DataFrame:
model = joblib.load(model_path)
features['predictions'] = model.predict(features)
Expand Down
3 changes: 2 additions & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
behave
pytest
pytest-cov
pytest-cov
vulture

0 comments on commit a57b85d

Please sign in to comment.