-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
284 additions
and
200 deletions.
There are no files selected for viewing
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
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
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
Empty file.
34 changes: 34 additions & 0 deletions
34
testsuite/ext-tools/machine_learning/evaluate_cucumber_report.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pandas as pd | ||
from joblib import load | ||
import json | ||
|
||
def evaluate_current_report(current_report_path, model_path, vectorizer_path, output_path): | ||
# Load data | ||
with open(current_report_path, 'r') as file: | ||
current_report = json.load(file) | ||
df = pd.DataFrame(current_report) | ||
|
||
# Load model and vectorizer | ||
model = load(model_path) | ||
vectorizer = load(vectorizer_path) | ||
|
||
# Preprocess and predict | ||
X = vectorizer.transform(df['text']) | ||
df['predicted_root_cause'] = model.predict(X) | ||
|
||
# Save predictions | ||
df.to_csv(output_path, index=False) | ||
print(f"Predictions saved to {output_path}") | ||
|
||
if __name__ == "__main__": | ||
import sys | ||
if len(sys.argv) != 5: | ||
print("Usage: python evaluate_current_report.py <current_report_path> <model_path> <vectorizer_path> <output_path>") | ||
sys.exit(1) | ||
|
||
current_report_path = sys.argv[1] | ||
model_path = sys.argv[2] | ||
vectorizer_path = sys.argv[3] | ||
output_path = sys.argv[4] | ||
|
||
evaluate_current_report(current_report_path, model_path, vectorizer_path, output_path) |
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
152 changes: 0 additions & 152 deletions
152
testsuite/ext-tools/machine_learning/gh_issues_train_model.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.