File size: 1,962 Bytes
2af6bca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
import streamlit as st 
import joblib 

# models

scaler=joblib.load('scaler_model.joblib')

insurance_model=joblib.load('insurance_fraud_model.joblib')

## Heading
html_temp = """

    <div style="background-color:tomato;padding:10px">

    <h2 style="color:Black;text-align:center;">Insurance Claims Analysis   </h2>

    </div>

    """
st.markdown(html_temp, unsafe_allow_html=True)

## inputs

## 'incident_cause'
option_incident=['Driver error',"Crime","Other driver error",'Natural causes','Other causes']
incident_case=st.selectbox("Select the cause of incident :",options=option_incident)
incident_values=option_incident.index(incident_case)

## 'claim_area'

option_claim_area=["Auto","Home"]
claim_area=st.selectbox("Select the Claim Area: ",option_claim_area)
claim_area_value=option_claim_area.index(claim_area)

## 'police_report'
option_police_report=['NO',"Unknow","Yes"]
police_report=st.selectbox("You have Given Police Report:",option_police_report)
police_report_value=option_police_report.index(police_report)

## 'claim_type'
option_claim_type=["Material only ","Injury only","Material and injury"]
claim_type=st.selectbox("Select the Type of Claim :",option_claim_type)
claim_type_value=option_claim_type.index(claim_type)

##  'claim_amount'
claim_amount=st.slider("Slide the Claim Amount:",min_value=1000,max_value=48150)

## 'total_policy_claims'
policy_claims=st.slider("Slide the No of Policies Claimed:",min_value=0,max_value=8)

if st.button("Submit"):
    # st.write(incident_values,claim_area_value,police_report_value,claim_area_value,claim_amount,policy_claims)
    values=scaler.transform([[incident_values,claim_area_value,police_report_value,claim_area_value,claim_amount,policy_claims]])
    #st.write(values)
    output=insurance_model.predict(values)
    if output==0:
        st.write("The Transaction is Not Faurd")
    else:
        st.write("The Transaction is Faurd")