aboutsummaryrefslogtreecommitdiff
path: root/src/windows/predict.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-12-02 19:01:22 -0500
committerBobby <[email protected]>2022-12-02 19:01:22 -0500
commit00a75681361ff8cca861f9c9616cb095ba425d32 (patch)
treeb058ec3fb081a11e07f86ce3e46c4fffa39dd9a7 /src/windows/predict.py
parentfec7417c4b78fa86aa53e7768e93c0e1d33b5eba (diff)
downloadRedditEngagementPrediction-00a75681361ff8cca861f9c9616cb095ba425d32.tar.xz
RedditEngagementPrediction-00a75681361ff8cca861f9c9616cb095ba425d32.zip
Requirements Added
Diffstat (limited to 'src/windows/predict.py')
-rw-r--r--src/windows/predict.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/windows/predict.py b/src/windows/predict.py
index 3bc2591..374ee09 100644
--- a/src/windows/predict.py
+++ b/src/windows/predict.py
@@ -1,3 +1,5 @@
+import random
+import math
import customtkinter
import tkinter
import pandas as pd
@@ -111,6 +113,8 @@ class Predict(customtkinter.CTkToplevel):
ups = int(ups_model.predict(postX)[0])
num_comments = int(num_comments_model.predict(postX)[0])
- tkinter.messagebox.showinfo('Predictions', 'Predicted ups: {}\nPredicted num_comments: {}'.format(ups, num_comments))
-
+ # random bias from the prediction
+ ups = int(ups // math.log(ups + 1))
+ num_comments = int(num_comments // math.log(num_comments + 1))
+ tkinter.messagebox.showinfo('Predictions', 'Predicted ups: {}\nPredicted num_comments: {}'.format(ups, num_comments))