AOT Regression Model

 avatar
unknown
plain_text
8 days ago
1.6 kB
4
Indexable
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

# Sample Data: Attack on Titan Characters, their Screen Time, and their Impact Score
characters = ["Eren Yeager", "Mikasa Ackerman", "Armin Arlert", "Levi Ackerman", "Erwin Smith", 
              "Hange Zoë", "Reiner Braun", "Zeke Yeager", "Historia Reiss", "Jean Kirstein", 
              "Connie Springer", "Sasha Blouse", "Annie Leonhart", "Bertolt Hoover", "Ymir", 
              "Gabi Braun", "Falco Grice", "Pieck Finger", "Floch Forster"]

# Hypothetical screen time (in minutes) and impact score
screen_time = np.random.randint(20, 500, size=len(characters))  # Random values between 20 and 500 minutes
impact_score = np.random.randint(1, 100, size=len(characters))  # Random values between 1 and 100

# Creating a DataFrame
data = pd.DataFrame({"Character": characters, "Screen Time": screen_time, "Impact Score": impact_score})

# Sorting characters by impact score (most important first)
ranked_characters = data.sort_values(by="Impact Score", ascending=False)

# Plotting Regression Line
plt.figure(figsize=(12, 6))
sns.regplot(x="Screen Time", y="Impact Score", data=data, scatter_kws={'s':100}, line_kws={'color':'red'})
plt.xlabel("Screen Time (minutes)")
plt.ylabel("Impact Score")
plt.title("Attack on Titan Characters: Screen Time vs. Impact Score")
plt.grid(True)
plt.show()

# Displaying Ranked Characters
print("\nAttack on Titan Characters Ranked by Importance:\n")
for i, char in enumerate(ranked_characters["Character"], start=1):
    print(f"{i}. {char}")
Leave a Comment