O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To use AdaBoost to combine classification tree models, follow these steps:

  1. Load the slam, sentiment, and twitterR packages:
> library(slam)> library(sentiment)> library(twitteR) 
  1. Set your API keys and secret keys information from the Twitter app and then authenticate using the twitter oauth method:
> api_key <- <your consumer or api key>> api_secret <- <your api key secret>> access_token <- <your access token>> access_token_secret <- < your access token secret>> setup_twitter_oauth(api_key, api_secret, access_token, access_token_secret)[1] "Using direct authentication"
  1. Now we will search Twitter based on the keyword "machinelearning", and the number of tweets to be ingested can be increased/decreased by modifying the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required