Code Monkey home page Code Monkey logo

cryptocurrency_investment_analysis_and_modeling's People

Contributors

jieyima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cryptocurrency_investment_analysis_and_modeling's Issues

Is there any other way to implement plotly Rโ€™s cumulative animation?

accumulate_by <- function(dat, var) {
  var <- lazyeval::f_eval(var, dat)
  lvls <- plotly:::getLevels(var)
  dats <- lapply(seq_along(lvls), function(x) {
    cbind(dat[var %in% lvls[seq(1, x)], ], frame = lvls[[x]])
  })
  dplyr::bind_rows(dats)
}

d <- txhousing %>%
  filter(year > 2005, city %in% c("Abilene", "Bay Area")) %>%
  accumulate_by(~date)

If you implement a cumulative animation in the manner of the function above, the number of rows will increase too much.

I use a thousand frames and a row of ten thousand. Because of the large number of data, the work in progress has been disturbed.

https://plot.ly/r/cumulative-animations/

Is there any way to create a cumulative animation other than the example?

The results of 2 different algorithms are the same

I used your project as a draft for an assignment and made some edits. This arrangement is that I'm estimating BTC with 2 different algorithms, but as you can see, the results of 2 different algorithms are the same. Does anyone know what you think I am doing wrong. Thanks for helping me @jieyima

https://ibb.co/HHHMkH7 and https://ibb.co/GPBymjr Photos

def regression1(X_train, X_test, y_train, y_test):
    Regressor = {'Random Forest Regressor': RandomForestRegressor(n_estimators=200)}

    for name, clf in Regressor.items():
        print(name)
        clf.fit(X_train, y_train)
        
        st = time.time()
        print(f'R-Squared: {r2_score(y_test, clf.predict(X_test)):.9f}')
        et = time.time()
        print(f'Mean absolute error: {mean_absolute_error(y_test, clf.predict(X_test)):.9f}')
        print(f'Mean squared error: {mean_squared_error(y_test, clf.predict(X_test)):.9f}')
        print('Execution time:', et - st)
        print()
        
# define regression function
def regression2(X_train, X_test, y_train, y_test):
    Regressor = {'Extreme Gradient Boosting Regressor': GradientBoostingRegressor(n_estimators=500)}

    for name, clf in Regressor.items():
        print(name)
        clf.fit(X_train, y_train)
        
        st = time.time()
        print(f'R-Squared: {r2_score(y_test, clf.predict(X_test)):.9f}')
        et = time.time()
        print(f'Mean absolute error: {mean_absolute_error(y_test, clf.predict(X_test)):.9f}')
        print(f'Mean squared error: {mean_squared_error(y_test, clf.predict(X_test)):.9f}')
        print('Execution time:', et - st)
        print()


# Bitcoin (BTC)
print('Bitcoin (BTC):')
regression1(X_train_BTC, X_test_BTC, y_train_BTC, y_test_BTC)


plt.figure(figsize=(15,8))
(bitcoin[:0]['daily_avg']).plot(label='Historical Price')
(bitcoin[-31:]['daily_avg']).plot(label='Predicted Price')

plt.xlabel('Time')
plt.ylabel('Price in USD')
plt.title('Prediction with Random Forest Regressor')

# Bitcoin (BTC)
print('Bitcoin (BTC):')
regression2(X_train_BTC, X_test_BTC, y_train_BTC, y_test_BTC)


plt.figure(figsize=(15,8))
(bitcoin[:0]['daily_avg']).plot(label='Historical Price')
(bitcoin[-31:]['daily_avg']).plot(label='Predicted Price')

plt.xlabel('Time')
plt.ylabel('Price in USD')
plt.title('Prediction with Extreme Gradient Boosting Regressor')```

new complementary tool

If you have problems with installation, let me know.
I am searching collaborators for this project. If you have experience and want to collaborate text me on email or github Issues

Why this stock prediction project ?

Things this project offers that I did not find in other free projects, are:

  • Testing with +-30 models. Multiple combinations features and multiple selections of models (TensorFlow , XGBoost and Sklearn )
  • Threshold and quality models evaluation
  • Use 1k technical indicators
  • Method of best features selection (technical indicators)
  • Categorical target (do buy, do sell and do nothing) simple and dynamic, instead of continuous target variable
  • Powerful open-market-real-time evaluation system
  • Versatile integration with: Twitter, Telegram and Mail
  • Train Machine Learning model with Fresh today stock data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.