Q:

How to avoid crossing my advisor if I write a paper as a sole author?

A bit of a controversial question here. I am a PhD student currently away from campus on an internship in another state (in the US). I left campus with my advisor-provided laptop and some dataset I collected while working in my advisor's lab. We had the mutual understanding that me taking the official lab's laptop to the place of my internship was in the spirit of me being able to do my research effectively while I am away from campus.
For the past four months, I have been working at my leisure hours at my place of internship and during weekends to investigate an algorithm with respect to the dataset I collected while working under my advisor -- in his lab. I should mention that since I am away on an internship, I am not his Research Assistant at least for now (until I return to campus). 
Aside from using the dataset I collected from his lab, I have scraped publicly available datasets from other research labs online and used them to rigorously test my algorithm. My algorithms are starting to yield promising results which I think are about right for a publication. Because my advisor has made little or no contribution to my work so far, I am not sure how appropriate it is to put his name on the paper I am writing which reports my findings so far. I have tacitly brought this up with him in emails  so far but he has not expressed any enthusiasm about whatever work I am doing remotely (perhaps he doesn't trust what he hasn't seen?). 
Since the deadline of the conference is coming up soon, how would you suggest I do not cross him if I write the paper as a sole author?

A:

If you don't know whether your advisor expects to be a co-author or not, just ask him.
If you feel that the advisor shouldn't be a co-author, you can present that as the "default":

I am planning to write up my work with X, to submit to conference Y. You haven't really been involved in this work so far, so I guess you won't co-author this paper with me. Is that right?

If based on the specifics of the situation you don't have any strong feelings against co-authoring this paper with him, but you just aren't sure what he wants, you can just ask him:

I am planning to write up my work with X, to submit to conference Y. Are you interested in co-authoring this paper with me?

As you have said, you can't read minds. The only way to know what's in his, is to communicate. 
And it's really important that you have this discussion as soon as possible; authorship disputes are much trickier to resolve after publication (when they can potentially lead to retraction) than before submission.

A:

Before answering, allow me to highlight some additional details OP posted in the comments below their post.
First, I asked OP if listing an advisor as a co-author is the default in his/her group, to which OP replied:

Yes, listing the advisor's name as the last author is the default in the group.

I also asked OP if the algorithm (s)he developed is related to his/her PhD topic, to which OP replied:

The algorithm is definitely related to my PhD topic, yes!

So, to summarize, your advisor's policy is that he/she expects to be an author on your papers by default, and the paper you are currently working on is relevant to your PhD topic. 
Thus, in the absence of any additional information, the only logical conclusion is that it is not possible for OP to avoid crossing their advisor by excluding the advisor as a co-author on the paper.

Some additional things to consider ...
Several questions on this site have addressed automatic co-authorship for advisors, such as How to explain to a student that it is common to include a supervisor as a co-author and When should a supervisor be an author?
Now, in the second linked question above, user JeffE provided an answer, which to me is an interesting take on the advisor co-authorship problem. In his answer, relating to advisors being co-authors on papers that result from projects for which they obtained a grant, JeffE writes:

In practice, writing a good grant proposal requires at least as much intellectual novelty as writing a good paper. Most of the good ideas that PIs pour into their proposals also appear in papers; as long as those ideas constitute novel intellectual contributions, the PI merits co-authorship. But that only works once per idea; once an idea has been published, it's no longer novel, by definition.

Does your advisor subscribe to the above philosophy, some other philosophy not mentioned above, or does "by default" mean that your advisor is always listed as a co-author? The only way to find out is to ask.
Whether it is advisable to approach advisor with these types of questions will depend on your working relationship with them, how important it is for you to exclude your advisor as an author from the paper, etc.

A:

I had passed through similar situations, and my conclusion is that if your advisor is a good scientist, he will understand that you need to work on some projects by yourself to develop your scientific skills. The only thing that I would advise you to do is to make him aware that you plan to submit the paper to a conference whose deadline is soon, or that you have already submitted it to conference. If your paper gets accepted without him knowing even that the paper was submitted, this could potentially leave him with the impression that you don't trust him. But even in this case, if he is a successful scientist, I bet he would only be happy for your accepted paper.  
In your situation I would write the paper and send him the best draft you have explaining that you plan to submit the paper to conference X. Or if the deadline is really close, I would submit the paper to the conference and send a copy to him saying that you have submitted this paper to the conference. In the title page of the paper you should put only your name, since so far he doesn't even know about the existence of the paper anyway. This would in my opinion be a clear message that you want to write the paper by yourself.  
Dear professor X, 
during my internship here at place Y I started working at project Z. I have wrote a paper about this project (attached) with the intention to submit it to conference W whose deadline is really close. Would you mind making some comments, if you have some time? If you don't mind I would like to try to finish this paper as a sole co-author. 
Best Regards,
Blabla
Asking him for comments does not turn him immediately into a co-author. In fact even the most senior scientists ask for the opinion of their colleagues. 
The good think about this approach is that he can potentially suggest improvements, or correct errors. In this case, you could put him in the acknowledgements if the paper gets accepted. If the paper does not goes through, you could still ask him for more suggestions and if he contributes enough, you can submit it to another conference/journal as a co-author. 
All in all, the only thing you should avoid is an atmosphere of mistrust. 

