How to reset Windows 8.1 to factory defaults?

My PC got some sort of virus or malware the other day which is slowing my internet down considerably, 35-40mbps to 0.1-1.5mbps (test done on speedtest.net).
I have used a whole host of anti-virus software to try and detect it but no luck, and I know there's something going on with my OS because my PC is dual-booted with ubuntu and when doing the same test in ubuntu I get the 35-40mbps download speed.
Unfortunately the dual-boot somehow corrupted my system backup drive so I can't restore through the normal channels (Lenovo OneKey Recovery and Windows USB partition tools both come up with errors saying the recovery drive can't be found).

Any help and/or advice on removing whatever is causing the issue or factory resetting my laptop would be greatly appreciated.

Added (1). Booted into safe mode with practically everything disabled my network speed shot up to 38mbps. Please can someone help I have no idea what is going on.
Everything but trusted applications deleted, internet history and cookies cleared, disabled all boot apps but the Microsoft and Lenovo ones.
I suppose I could delete the "temp" folder if I knew where it was, so I'll start digging.

Added (2). Contents of temp folder deleted, now my download speed is around 11mbps. This is even more confusing. Hardware issue ruled out by Ubuntu boot test, driver issue ruled out by safe mode boot, so logically the only possibility left is malware, so why does deleting the contets of the temp folder half fix it?

Restore is a very last and undesirable resort. It requires too much time and work.
The worst thing is that you erase so many treasures that you have gathered.
Restoring to a time prior problems is ok but neither of them teach you how to maintain your PC. You my be able to understand that it is worse than wiping out a phone that has a large music library and a great contact list and a large picture library because you have no copies of those things on your PC after the factory reset. Any programs that you have installed will be gone. All software updates will be gone.

The most simple and most often overlooked problem is that unwanted junkware programs get loaded on PCs. They cause a hugh slow down.
The fix is to go to uninstall programs in the OS and uninstall the amazing number of foreign programs that you did not know had loaded. Uninstall all of them. Research the ones that you do not recognize

Item number two- also overlooked is that the browser has a problem. The simple test is use a different browser.

Item number three is that the PC is totally bogged down with programs that are loaded into memory at startup The fix is to type "msconfig" in the search box and click on msconfig.exe. Now click on startup in the top right and uncheck absolutely every program that you no not use on a very frequent basis. No worry-they are still on your system and will work fine but no longer bogging down memory.

A final thing is after you have rebooted go on line and click on tools and internet options and click to delete temp internet files.

Fasten your seatbelt and browse. Save this for later use.

Fresh install is the easiest way