Question: Is it possible to do clustering without providing any input apart from the data? The clustering method/algorithm should decide from the data on how many logical groups the data can be divided, even it doesn't require me to input the threshold eucledian distance on which the clusters are built, this also needs to be learned from the data.

Could you please suggest me what is closest solution for my problem?

Answer: 
`deliver_now` Delivers an email at a time.

If you use `deliver_later` you have to use ActiveJob runner like `Sidekiq` you can see this [`gist Sending emails with ActionMailer and Sidekiq`](https://gist.github.com/maxivak/690e6c353f65a86a4af9) also see this for basic [`Sidekiq`](https://github.com/mperham/sidekiq/wiki/Active-Job#action-mailer) email sent.

Enqueues the email to be delivered through Active Job. When the job runs it will send the email using `deliver_now`.

```
UserMailer.welcome_email(self).deliver_later(wait: 1.hour)

```

[`method-i-deliver_later`](http://api.rubyonrails.org/classes/ActionMailer/MessageDelivery.html#method-i-deliver_later)

Basically, `deliver_later` is asynchronous. When you use this method, the email is not sent at the moment, but rather is pushed into a job's queue. If the job is not running, the email will not be sent. `deliver_now` will send the email at the moment, no matter what is the job's state. [Here](http://api.rubyonrails.org/classes/ActionMailer/MessageDelivery.html#method-i-deliver_later) you can see the documentation for delivery methods.
### What ActiveJob backend are you using?

* ActiveJob to provide asynchronous execution but does not provide asynchronicity itself.

You need to use some asynchronous backend like `sidekiq`, `delayed_job` or something else.