<jupyter_start><jupyter_text>Dataset Source : Kaggle DatasetResource and Code : Computer Science youtube channellink: https://www.youtube.com/watch?v=FMKnvsKoQxE<jupyter_code>import pandas as pd
import numpy as np
df=pd.read_csv('DOGE-USD.csv')
#set index as date
df=df.set_index(pd.DatetimeIndex(df['Date'].values))
df.head()
df.isnull().sum()
df["Open"].fillna( method ='ffill', inplace = True)
df["High"].fillna( method ='ffill', inplace = True)
df["Low"].fillna( method ='ffill', inplace = True)
df["Close"].fillna( method ='ffill', inplace = True)
df["Adj_Close"].fillna( method ='ffill', inplace = True)
df["Volume"].fillna( method ='ffill', inplace = True)

df.isnull().sum()
df=df[['Close']]
df.head()
pred_day=1
#collect the future price:
df['Prediction']=df[['Close']].shift(-pred_day)
df.tail()
x=np.array(df.drop(['Prediction'],1))
x=x[:len(df)-pred_day-1]
x
#create a dependent dataset
y=np.array(df['Prediction'])
y=y[:-pred_day-1]

y
#split the data into 80:20:
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test= train_test_split(x,y,test_size=0.2)
from sklearn.ensemble import RandomForestRegressor
forest = RandomForestRegressor(n_estimators=4,random_state=587)
forest.fit(x_train,y_train)
print(forest.score(x_test,y_test))
#show the values vs actual
pred=forest.predict(x_test)
#print:
print(pred)
print()
print(y_test)
df2=df[:-pred_day]
x_val=df2.tail(1)['Close'][0]
print(x_val)
prediction=forest.predict([[x_val]])
print('The price of DogeCoin in',pred_day,'day(s) is to be',prediction)
print('The actual price was :',df2.tail(1)['Prediction'][0])<jupyter_output>The price of DogeCoin in 1 day(s) is to be [0.03292475]
The actual price was : 0.047708
{'fraction_non_alphanumeric': 0.17291910902696367, 'fraction_numerical': 0.022274325908558032, 'mean_word_length': 7.798969072164948, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '488225', 'license': 'MIT', 'n_tokens_mistral': 698, 'n_tokens_neox': 672, 'n_words': 137, 'path': 'DogeCoin/DogeCoin Price Prediction.ipynb', 'repo_name': 'prithwiswarb/Personal-Projects', 'size': '1706'}