Views
No views yet
1pip install scikit-learn pandas joblib
2import joblib
3import pandas as pd
4
5# Download and load the model
6model = joblib.load('model.pkl')
7
8# Prepare your data (should match training format)
9# Example features dictionary
10customer_data = {
11 'Age': 35,
12 'TypeofContact': 1,
13 'CityTier': 1,
14 'Occupation': 2,
15 'Gender': 1,
16 'NumberOfPersonVisiting': 2,
17 'PreferredPropertyStar': 4,
18 'MaritalStatus': 1,
19 'NumberOfTrips': 3,
20 'Passport': 1,
21 'OwnCar': 1,
22 'NumberOfChildrenVisiting': 0,
23 'Designation': 2,
24 'MonthlyIncome': 75000,
25 'PitchSatisfactionScore': 4,
26 'ProductPitched': 2,
27 'NumberOfFollowups': 3,
28 'DurationOfPitch': 30
29}
30
31# Convert to DataFrame
32df = pd.DataFrame([customer_data])
33
34# Make prediction
35prediction = model.predict(df)
36probability = model.predict_proba(df)
37
38print(f"Will purchase: {'Yes' if prediction[0] == 1 else 'No'}")
39print(f"Confidence: {probability[0][1]:.2%}")```
40
41
42Built as part of the "Visit with Us" MLOps Project