|
|
|
import streamlit as st
|
|
import joblib
|
|
import numpy as np
|
|
|
|
|
|
model = joblib.load("got_isalive_model.pkl")
|
|
house_encoder = joblib.load("got_house_encoder.pkl")
|
|
title_encoder = joblib.load("got_title_encoder.pkl")
|
|
|
|
st.title("🛡️ Game of Thrones – Hayatta mı?")
|
|
|
|
|
|
male = st.selectbox("Cinsiyet", ["Erkek", "Kadın"])
|
|
popularity = st.slider("Popülarite (0-1 arası)", 0.0, 1.0, 0.5)
|
|
house = st.selectbox("House", house_encoder.classes_)
|
|
title = st.selectbox("Title", title_encoder.classes_)
|
|
|
|
|
|
male_val = 1 if male == "Erkek" else 0
|
|
house_val = house_encoder.transform([house])[0]
|
|
title_val = title_encoder.transform([title])[0]
|
|
|
|
|
|
X_input = np.array([[male_val, popularity, house_val, title_val]])
|
|
prediction = model.predict(X_input)[0]
|
|
|
|
if prediction == 1:
|
|
st.success("✅ Bu karakter hayatta!")
|
|
else:
|
|
st.error("☠️ Bu karakter maalesef ölmüş.")
|
|
|