﻿ Live Bitcoin MINING Session +8% In 30 Minutes ⇐ – Sentdex

# Live Bitcoin MINING Session +8% In 30 Minutes ⇐ – Sentdex

• Live Bitcoin MINING Session +8% In 30 Minutes ⇐ – Sentdex
• Sentdex API
• Technical – Bitcoin Price Network Blockchain News
• Sentdex Analysis
• Bitcoin trading and Investing - Intro - BitcoinSlate.com ##### Linear Regression following Sentdex's tutorials

Hello. I am trying to do some machine learning on some bitcoin data, specifically linear regression. The full code is here, but in order to plot it on a graph, I want to use the values of y (which is the values of x in 14.5 days time, so price in 14.5 days time) where I use the old actual values of y followed by the new values of y which are the predictions. In order to do this I need to find the values of X which have values for y (the predictions) and the values for x which already have the price in 14.5 days time. I performed a shift on the data, meaning some Xs have values for Y in 14.5 days time and some don't.
Why 14.5 days? As the data set is 1450 days long and I did a 0.01 negative shift. Hopefully I communicated what I was trying to say alright.
import pandas as pd import math import numpy as np from sklearn import preprocessing, svm from sklearn.model_selection import cross_validate from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from statistics import mean import matplotlib.pyplot as plt from matplotlib import style df = pd.read_csv("coinbaseUSD_1-min_data_2014-12-01_to_2019-01-09.csv") df['date'] = pd.to_datetime(df['Timestamp'],unit='s').dt.date print("calculating...") forecast_col = 'Weighted_Price' forecast_out = int(math.ceil(0.01*len(df))) #forecast_out = 20998 = 20998 minutes = 14.5 days df['label'] = df[forecast_col].shift(-forecast_out) df = df[['date', 'Weighted_Price', 'label']] df.dropna(inplace=True) X = np.array(df['Weighted_Price'], dtype = np.float64) y = np.array(df['label'], dtype=np.float64) X_lately = X[-forecast_out:] X = X[:-forecast_out:] def best_fit_line(X, y): m = (((mean(X) * mean(y)) - mean(X*y)) / ((mean(X) * mean(X)) - mean(X*X))) c = mean(y) - (m * (mean(X))) return m, c m, c = best_fit_line(X, y) print(m, c) regression_line = [(m*values) for values in X] plt.scatter(X, y) plt.plot(X, regression_line) plt.show()

So what have I tried? The offender is this line here:
X_lately = X[-forecast_out:] X = X[:-forecast_out:]
That is what sentdex did in the video series, but I get the error: ValueError: operands could not be broadcast together with shapes (1871868,) (1892866,)
This doesn't work with:
m = (((mean(X) * mean(y)) - mean(X*y)) / ((mean(X) * mean(X)) - mean(X*X)))
due to this making the X and Ys different lengths? I'm not sure.
What am I doing wrong?

##### Bitcoin BTCUSD sentiment analysis graph

Thought I'd share some of the sentiment analysis compared to price that I've done on Bitcoin over the past few months.
I do this mostly for stocks, but started doing it for bitcoin a bit ago out of fun/curiosity. I am pretty happy with how well it has turned out so far. Edit: Fixed the bad price glitches from BTC-e.
It also takes a bit to load. It's a lot of data. Expect to wait about a minute for it to load the actual chart.
http://sentdex.com/bitcoin/
To save loading if you'd like, here's just an image of the current graph: http://imgur.com/0JrFHOW

##### Bitcoin sentiment analysis + any interest in Geo sentiment?

You all like to talk and opine about bitcoin very much, I like to measure your feelings.
Bitcoin sentiment analysis chart: http://sentdex.com/bitcoin/
Some of you might be familiar with it from before, but we've made some changes, including adding micropayments to view...and then removing them due to glitches as well as "micro" payments not being so micro after all...
The chart still takes a decent while to load, but we've revamped the code quite a bit to help with loading, but it still takes ~45 seconds.
Bitcoin is by far the largest topic Sentdex covers for sentiment analysis. The amount of data we collect on bitcoin is well over 10x our most popular talked about stock, which is Apple.
The goal is to use sentiment to predict price movements in Bitcoin / other stocks. Of course, many times price moves and then people get excited. This can be seen, but we've also been able to precede movements on many occasions.
Bitcoin is still a very new topic for us to cover. We've got a lot of data on it now, but we couldn't really go back in history as far for machine learning like we could with the rest of the stocks. Anyway, thought I'd share.
Curiously, I also wonder if there's any interest for people to see Geographic sentiment analysis for Bitcoin? I do geographic sentiment analysis here: http://sentdex.com/global-sentiment-analysis/
I've got things like Google and Facebook just for kicks. I'm also able to get popular words based on regions. Currently I only do this for the general sentiment chart, but I wonder too about doing this with Bitcoin. Thoughts? Might be pretty cool to see bitcoin sentiment by region.     