Reputation: 117
I am using redisbayes library in python to implement naive bayes classification. But when I write -
rb = redisbayes.RedisBayes(redis=redis.Redis())
rb.train('good', 'sunshine drugs love sex lobster sloth')
It gives the following error -
ConnectionError: Error 10061 connecting localhost:6379.
No connection could be made because the target machine actively refused it.
I tried doing it this way -
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
rb = redisbayes.RedisBayes(redis=redis.Redis(connection_pool=pool))
But it gives the same error. I am not being able to find a solution to this. How can I establish a connection to redis using python, or this any other way to do naive bayes classification in python using training data from MySQL?
Upvotes: 1
Views: 3460
Reputation: 34718
You do realise you need to have a Redis server running locally to be able to connect to it, take a look in your process list for redis-server
if its not there and you don't have a registered service you might need to install it. Take a look at the installation instructions on the redis homepage
Upvotes: 5