Update app.py
Browse files
app.py
CHANGED
@@ -52,8 +52,9 @@ options = [
|
|
52 |
with open("model.pkl", "rb") as f:
|
53 |
model = pickle.load(f)
|
54 |
|
55 |
-
def win_position(assists, boosts, damageDealt, DBNOs, headshotKills, heals, killPlace, killPoints, kills, killStreaks, longestKill, matchDuration,
|
56 |
|
|
|
57 |
f_assists = float(assists)
|
58 |
f_boosts = float(boosts)
|
59 |
f_damageDealt = float(damageDealt)
|
@@ -66,7 +67,6 @@ def win_position(assists, boosts, damageDealt, DBNOs, headshotKills, heals, kill
|
|
66 |
f_killStreaks = float(killStreaks)
|
67 |
f_longestKill = float(longestKill)
|
68 |
f_matchDuration = float(matchDuration)
|
69 |
-
f_matchType = options.index(matchType)
|
70 |
f_maxPlace = float(maxPlace)
|
71 |
f_numGroups = float(numGroups)
|
72 |
f_rankPoints = float(rankPoints)
|
@@ -81,6 +81,7 @@ def win_position(assists, boosts, damageDealt, DBNOs, headshotKills, heals, kill
|
|
81 |
f_winPoints = float(winPoints)
|
82 |
|
83 |
default = [
|
|
|
84 |
f_assists,
|
85 |
f_boosts,
|
86 |
f_damageDealt,
|
@@ -93,7 +94,6 @@ def win_position(assists, boosts, damageDealt, DBNOs, headshotKills, heals, kill
|
|
93 |
f_killStreaks,
|
94 |
f_longestKill,
|
95 |
f_matchDuration,
|
96 |
-
f_matchType,
|
97 |
f_maxPlace,
|
98 |
f_numGroups,
|
99 |
f_rankPoints,
|
@@ -119,6 +119,7 @@ iface = gr.Interface(
|
|
119 |
title="Win Predict",
|
120 |
allow_flagging="never",
|
121 |
inputs=[
|
|
|
122 |
gr.inputs.Number(default= 0, label="assists"),
|
123 |
gr.inputs.Number(default= 8, label="boosts"),
|
124 |
gr.inputs.Number(default= 501.5, label="damageDealt"),
|
@@ -131,7 +132,6 @@ iface = gr.Interface(
|
|
131 |
gr.inputs.Number(default= 2, label="killStreaks"),
|
132 |
gr.inputs.Number(default= 115.9, label="longestKill"),
|
133 |
gr.inputs.Number(default= 1810, label="matchDuration"),
|
134 |
-
gr.Dropdown(options, default='squad-fpp', label="matchType"),
|
135 |
gr.inputs.Number(default= 30, label="maxPlace"),
|
136 |
gr.inputs.Number(default= 30, label="numGroups"),
|
137 |
gr.inputs.Number(default= -1, label="rankPoints"),
|
|
|
52 |
with open("model.pkl", "rb") as f:
|
53 |
model = pickle.load(f)
|
54 |
|
55 |
+
def win_position(matchType, assists, boosts, damageDealt, DBNOs, headshotKills, heals, killPlace, killPoints, kills, killStreaks, longestKill, matchDuration, maxPlace, numGroups, rankPoints, revives, rideDistance, roadKills, swimDistance, teamKills, vehicleDestroys, walkDistance, weaponsAcquired, winPoints):
|
56 |
|
57 |
+
f_matchType = options.index(matchType)
|
58 |
f_assists = float(assists)
|
59 |
f_boosts = float(boosts)
|
60 |
f_damageDealt = float(damageDealt)
|
|
|
67 |
f_killStreaks = float(killStreaks)
|
68 |
f_longestKill = float(longestKill)
|
69 |
f_matchDuration = float(matchDuration)
|
|
|
70 |
f_maxPlace = float(maxPlace)
|
71 |
f_numGroups = float(numGroups)
|
72 |
f_rankPoints = float(rankPoints)
|
|
|
81 |
f_winPoints = float(winPoints)
|
82 |
|
83 |
default = [
|
84 |
+
f_matchType,
|
85 |
f_assists,
|
86 |
f_boosts,
|
87 |
f_damageDealt,
|
|
|
94 |
f_killStreaks,
|
95 |
f_longestKill,
|
96 |
f_matchDuration,
|
|
|
97 |
f_maxPlace,
|
98 |
f_numGroups,
|
99 |
f_rankPoints,
|
|
|
119 |
title="Win Predict",
|
120 |
allow_flagging="never",
|
121 |
inputs=[
|
122 |
+
gr.Dropdown(options, default='squad-fpp', label="matchType"),
|
123 |
gr.inputs.Number(default= 0, label="assists"),
|
124 |
gr.inputs.Number(default= 8, label="boosts"),
|
125 |
gr.inputs.Number(default= 501.5, label="damageDealt"),
|
|
|
132 |
gr.inputs.Number(default= 2, label="killStreaks"),
|
133 |
gr.inputs.Number(default= 115.9, label="longestKill"),
|
134 |
gr.inputs.Number(default= 1810, label="matchDuration"),
|
|
|
135 |
gr.inputs.Number(default= 30, label="maxPlace"),
|
136 |
gr.inputs.Number(default= 30, label="numGroups"),
|
137 |
gr.inputs.Number(default= -1, label="rankPoints"),
|