def test_tweetio_read_train(self): pd.set_option("display.max_rows",100) pd.set_option("display.max_columns",100) coin = Coin() coin.name = 'neo' coin.read_from_storeage('train') print(coin.data_to_predict) print("test case finishes.")
def test_tweetio_read_predict(self): pd.set_option("display.max_rows",100) pd.set_option("display.max_columns",100) tio = TweetIO() coin = Coin() coin.name = 'omg' nowdt = datetime.now() argtime='2018-04-14_16-00-00' coin.read_from_storeage('rt','runtime/'+argtime+'/') print(coin.data_to_predict) print("test case finishes.")
def test_increase_one_hour(self): cointrain = CoinTrain() #df=pd.DataFrame(index=['year', 'month','day','hour'],columns=[i],data=) coin = Coin() coin.path = "./data/altcoin-1hour/neo.csv" coin.name = "neo" coin.ico = "2017-12-31" coin.read_from_storeage("prepare2") gtdf = coin.gtdf idx = gtdf.index gtdf.index = idx.set_names(['year', 'month', 'day', 'hour']) print(gtdf['sum_neumulfollower'].tail(27)) gtdf = cointrain.increase_by_one_hour(gtdf) print(gtdf['sum_neumulfollower'].tail(27))
import pandas as pd print('Main starts') #cinfo=CoinInfo() #coinlist=cinfo.list_coins('./data/altcoin-1hour') ## choosing first one: neo #coin=coinlist[19] coin = Coin() coin.path = "./data/altcoin-1hour/ada.csv" coin.name = "ada" coin.ico = "2017-10-01" #coin.ico="2016-02-17" tweetio = TweetIO() coin.read_from_storeage("prepare1") print(coin.tweets.columns) print(coin.retweets.columns) df = tweetio.sort_and_clip(coin.tweets, coin.ico) coin.tweets = df ## MULTIPLYING RETWEETS FOLLOWERS print("multiplying nr. of retweet followers by sentiments.") sentanalyzer = SentimentAnalyzer() sentanalyzer.merge_tweets_with_retweets(coin) #print(coin.tweets) sentanalyzer.sent_mul_tweet_followers(coin) sentanalyzer.sent_mul_retweet_followers(coin) print(len(coin.retweets))