This is the class of NostradaTul
(Nostradamus + Tulakan = NostradaTul).
I created this class because Tul always correctly predict the successful rate
of me on hitting up a girl randomly selected from population of Thai girls
(prediction is either successful
or unsuccessful
).
This prediction class I wrote is dedicated to Tulakan, I called it NostradaTul
predictor.
class NostradaTul():
def __init__(self, precision=0.99, recall=0.99):
self.precision = precision
self.recall = recall
self.f_score = 2 * precision * recall / (precision + recall)
def fit(self, X):
print("NostraTul doesn't need training data for predicting successful rate. He knows the outcome.")
return
def predict(self, X):
print("You don't need to give us testing data, ask NostradaTul directly for the prediction")
return None
def fit_predict(self, X, y):
print("The prediction is exact. Always. Cause this is NostradaTul")
y_pred = y
return y_pred # always true, one-on-one mapping to output
example usage:
import numpy as np
nostra = NostradaTul()
X, y = np.random.randn(10,10), np.random.randn(10)
nostra.fit_predict(X, y) # "The prediction is exact. Always. Cause this is NostradaTul"
print(nostra.f_score) # return 0.99, always (leave 0.01 just to make it a little more trustworthy)