-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_models.py
42 lines (36 loc) · 1.33 KB
/
test_models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# test_models.py
import joblib
import numpy as np
def test_credibility_model():
try:
credibility_model = joblib.load('credibility_model.joblib')
print("Credibility Model loaded successfully.")
except Exception as e:
print(f"Error loading Credibility Model: {e}")
return
# Test input
test_input = np.array([[75000, 150000]])
try:
prediction = credibility_model.predict(test_input)
print(f"Credibility Prediction: {prediction}")
except Exception as e:
print(f"Error predicting Credibility: {e}")
def test_influencer_model():
try:
influencer_model = joblib.load('influencer_model.joblib')
print("Influencer Model loaded successfully.")
except Exception as e:
print(f"Error loading Influencer Model: {e}")
return
# Test input (including credibility_weight)
test_input = np.array([[15000, 750, 75, 7, 25, 3, 0.90]])
try:
prediction = influencer_model.predict(test_input)
print(f"Influencer Prediction: {prediction}")
except Exception as e:
print(f"Error predicting Influencer Score: {e}")
if __name__ == "__main__":
print("Testing Credibility Model:")
test_credibility_model()
print("\nTesting Influencer Model:")
test_influencer_model()