MCPcopy
hub / github.com/owocki/pytrader / predict

Method predict

history/models.py:390–398  ·  view source on GitHub ↗
(self, sample)

Source from the content-addressed store, hash-verified

388 return clf
389
390 def predict(self, sample):
391 last_sample = sample[-1]
392 nn_price = 0.00
393 sample = StandardScaler().fit_transform(sample)
394 recommend = self.clf.predict(sample)
395 recommend_str = 'HOLD' if recommend[0] == ClassifierTest.HOLD else (
396 'BUY' if recommend[0] == ClassifierTest.BUY else 'SELL')
397 projected_change_pct = 0.00
398 return recommend_str, nn_price, last_sample, projected_change_pct
399
400 def graph_url(self):
401 return '/static/' + str(self.pk) + '.png'

Callers 3

get_classifierMethod · 0.45
graphMethod · 0.45
run_predictorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected