File size: 3,378 Bytes
540f528
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
import streamlit as st
import joblib
import numpy as np
import pandas as pd
from MLmodel import PrepProcesor, columns
model = joblib.load('F:\我的量化\Risk_protocol\LGmodel.joblib')


st.title("Did the project succeed")
Wallet_distribution = st.select_slider('Choose distribution score', [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
Whale_anomalie_activities = st.select_slider('Choose anomalie activities', [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
Locked_period = st.slider('Remaining days to next unlocked date', 0,180)
Operation_duration = st.number_input('Operation duration', 0,1000)
PR_articles = st.number_input('PR article number', 0, 1000)
Decentralized_transaction = st.select_slider('Transactions percentage in decentralized exchanges',[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0] )
twitter_followers_growthrate = st.number_input('twitter followers increased rate', -0.5,0.5)
unique_address_growthrate = st.select_slider('Unique address weekly growth rate', [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
month_transaction_growthrate = st.number_input('Monthly transaction increased rate', -0.5,3.0)
github_update = st.number_input("Project's github monthly update frequency", 0, 30)
code_review_report = st.select_slider('Has a review report or no, true=0, false=1', [0, 1])
publicChain_safety = st.number_input('How many vulnerabilities for the used blockchain', 0,100)
investedProjects = st.select_slider('Risky invested projects weight', [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
token_price = st.number_input('Input the token price', 0.0, 1000.0)
token_voltality_overDot = st.number_input('Input the token price voltality over the Dot price', -0.5,3.0)
negative = st.number_input('twitter comments? Negative=-1', 0,1)
neutre = st.number_input('twitter comments? neutre=0', 0,1)
positive = st.number_input('twitter comments? positive=1', 0,1)
KOL_comments = st.slider('How many negative comments that the KOLs have made', 0,100)
media_negatifReport = st.number_input('How many negative media report concerning this project', 0,100)


#st.text_input('Input passenger id', '12345')
# passengerclass = st.select_slider('Choose passenger class', [1,2,3])
# name = st.text_input('Input the passenger name', 'John Smith')
# gender = st.select_slider('Select gender', ['male', 'female'])
# age = st.slider('Input age', 0,100)
# sibsp = st.slider('Input siblings', 0, 10)
# parch = st.slider('Input parents/children', 0, 2)
# ticketid = st.number_input('Ticket number', 12345)
# fare = st.number_input('Fare amount', 0,100)
# cabin = st.text_input('Enter cabin', 'C52')
# embarked = st.selectbox('Choose embarkation point', ["S", "C","Q"])

def predict():
    row = np.array([Wallet_distribution, Whale_anomalie_activities, Locked_period, Operation_duration, PR_articles, Decentralized_transaction,twitter_followers_growthrate, unique_address_growthrate, month_transaction_growthrate,
                   github_update, code_review_report, publicChain_safety, investedProjects,
                   token_price,token_voltality_overDot, negative, neutre, positive, KOL_comments, media_negatifReport])
    X = pd.DataFrame([row], columns=columns)
    prediction = model.predict(X)[0]

    if prediction == 1:
        st.success('Project succeed :thumbsup:')
    else:
        st.error("Project did not succeed :thumbsdown:")


trigger = st.button('Predict', on_click=predict)