diff --git a/ai-auditor-module/audit.py b/ai-auditor-module/audit.py index dae3729b0..c63bceb24 100644 --- a/ai-auditor-module/audit.py +++ b/ai-auditor-module/audit.py @@ -3,14 +3,16 @@ from sklearn.preprocessing import StandardScaler # Load AI model -model = joblib.load('ai_model.joblib') +model = joblib.load("ai_model.joblib") # Load smart contract data -smart_contract_data = pd.read_csv('smart_contract_data.csv') +smart_contract_data = pd.read_csv("smart_contract_data.csv") # Preprocess data scaler = StandardScaler() -smart_contract_data[['feature1', 'feature2',...]] = scaler.fit_transform(smart_contract_data[['feature1', 'feature2',...]]) +smart_contract_data[["feature1", "feature2", ...]] = scaler.fit_transform( + smart_contract_data[["feature1", "feature2", ...]] +) # Make predictions predictions = model.predict(smart_contract_data) @@ -18,6 +20,6 @@ # Analyze predictions for i, prediction in enumerate(predictions): if prediction == 1: - print(f'Smart contract {i} is vulnerable!') + print(f"Smart contract {i} is vulnerable!") else: - print(f'Smart contract {i} is secure.') + print(f"Smart contract {i} is secure.")