r/javahelp • u/bhawint • Jul 20 '19
How can I begin to learn machine learning with java.
Basically I have no idea about any other programming language than (core) java... Could you please help me with those machine learning tutorials that give a walkthrough for java? I tried finding but most of the tutorials I managed to find are for python. Thanks
5
u/8igg7e5 Jul 20 '19
If you get a decent number of proposed strategies, for learning machine learning, you could develop some experimental data and use machine learning to derive the best ways to learn about machine learning.
In seriousness, if you are a beginner to programming then machine learning is not the place to start. As machine learning can be done in many languages, you need to decide which language you really want to learn - if that's still Java then I suggest looking at the University of Helsinki MOOC as a reasonable starting point (though the 2013 English version of the course only teaches Java 7 concepts - I really hope the newer MOOC gets translated).
1
u/my5cent Jul 20 '19
Theres plenty of youtube videos..I do recommend within a year ones as the older ones tend to be like scientist complex info that would probably lose you. Take a look into raspberry pi stuff intros. I think its python related. If you understand java then it's going to be easy learning other languages. The difference with ml is the framework its encapsulated in. Maybe not the right word framework but a controller that interfaces with the machine.
-3
u/NooskiDelanatto Jul 20 '19
My friend, learn python you won’t regret it. I had to take all sorts of courses in C, Java, Linux kernel etc. for my degree and hated my life. Taught myself python on my own (1 $10 Udemy course when they were having a sale) and it changed my life. It is so easy that it is literally easier than formulas in excel. Don’t even get me started on the libraries... in 5 lines of python you can do what would take hundreds in C++ if not thousands
-4
u/nutrecht Lead Software Engineer / EU / 20+ YXP Jul 20 '19
If you don't explain what the problem is we can't help you.
1
u/bhawint Jul 20 '19
I want to get started with machine learning... I am a beginner and don't have any specific problem... I want to learn how machine learns and need someone to help me with a walkthrough for programming it. I tried finding training material for java but it appears to be way out of my grasp. Need something that could teach me in an easy-to-understand manner.
6
u/matemik Jul 20 '19
If you are insisting on Java then you must first master the language, so start there. But if your goal is really ML, then you should really rather learn Python. Thats just my 2 cents.
1
u/bhawint Jul 20 '19
That's what the consensus says... Could you please share how you earned these two cents, I mean any reason why python and not java for machine learning? The reason why I am latching on to java is because of my myopic belief that the use of java is more prevalent for commercial purposes... Will I still be able to have a commercial mindset should I opt for python?
2
u/matemik Jul 20 '19
These two cents come from the fact that most companies use Python as a primary language when it comes to ML. At least as far as i know. And if you'll be looking for a job in that field, moat likely they will be requiring a knowledge of Python. Yes, you can do ML probably in any language. But the reason why Python is so popular is because of its simplicity. I have to say i am nowhere an expert on the matter, but it definitely seems like a no-brainer when it comes to choosing how to do ML today.
1
u/bhawint Jul 20 '19
Thanks a lot man... Do you mind if I ask you one more question? Is it reasonable to have a mindset of learning ML (using tutorials) on python and then to apply the concepts I've learned in java... Do you see this being a feasible path, given a visible difference in availability of ML libraries in these two languages? Plus could you suggest any good python tutorials for embarking on ML? Thank you so much for the guidance... Really appreciate it.
1
u/matemik Jul 20 '19
No problem. But as i've said, im not an expert in ML. I would suggest you start aome basic programming in Python, to get a feel for the language and syntax. Get to know the package manager (pip), you will need it a lot. If you are looking for some tutorials, check out Corey Schafer and Sentdex on Youtube, they have very good python content. As far as ML goes, i wouldnt know of a good learning resource, maybe find a subreddit about ML and check its content for resources, im sure there are plenty mentioned on reddit. Good luck!
1
1
Jul 20 '19
Different tools for different jobs. Most commercial purposes do not involve machine learning. Also, don't underestimate how widespread Python is.
https://www.tiobe.com/tiobe-index/
http://pypl.github.io/PYPL.html
https://hackernoon.com/top-3-most-popular-programming-languages-in-2018-and-their-annual-salaries-51b4a7354e06
I think your question requires a good understanding of fundamentals to really 'get' the choice of Python over Java, and the truth is most Junior / Intermediate programmers will just go with the flow (if people say use Python, they'll use Python).
First of all, there's the fact that Java is strongly typed while Python isn't. With machine learning you're not that sure about the type of data you'll be parsing, and honestly you don't care. The "typical commercial purpose" might be, for example, a page/window where a person types data in a form, where you know you have a date of birth, or a credit card number, a name, etc. You know what you'll be getting. With machine learning, you want to parse data to find out what you're getting, and then do something with that information.
Secondly, there's the compiled-language vs scripting question. With Java, your code has to make sense at compile time, with a scripting language it doesn't. That might not seem like an important distinction, I mean you always want to write code that makes sense, "duh", but the subtle thing here is that with a scripting language your code can generate code. You can have a script with blanks to be filled during run time by another script, generating a completely different result when it's run. It only has to make sense at run-time. You could even have the script run itself with some alterations (do note here, this is actually why for the typical commercial purpose a strongly-typed, compiled language is better. It protects programmers from their on code through type checks and validations during compilation. It makes sure your code is ok for you).
So with all that said, people choose Python over Java for machine-learning because it's one of the most widespread weak-typed scripting languages.
1
u/bhawint Jul 21 '19
That is very helpful... Thanks for taking time out for my query... After all that I have accumulated from you folks, I have switched to python for ML.... Really appreciate your help... Good luck! :)
1
u/nutrecht Lead Software Engineer / EU / 20+ YXP Jul 20 '19
I want to learn how machine learns and need someone to help me with a walkthrough for programming it.
Yeah that's not going to be happening. This sub will generally give advice, but we won't be holding hands.
Need something that could teach me in an easy-to-understand manner.
Machine learning is not easy. Either deal with it that it's a hard subject, or find something else to learn. That's all there's to it, sorry.
1
u/bhawint Jul 20 '19
Hahaha... A great reality check... But how come so many easy tutorials are available for python and not for java? It would be great if you could point me a ML guide that's based on java... Would be really helpful... Thank you so much for the guidance. Appreciate your help.
1
u/voccii Jul 20 '19
go do some research on your own. if you are looking for REALLY EASY tutorials for ML, you can start here
I can only provide you with that much. You got to do the research yourself, like everybody else.
Good luck though. The journey is definitely not easy
8
u/throwaway0891245 Jul 20 '19
Reality check: If you want to do serious machine learning, you want to learn Python.
The reason why is because a lot of machine learning algorithms are so compute intensive that they need highly optimized low level language code often interfacing with a GPU specific language. The amount of work needed to implement that sort of thing well is on the multi-organization scale.
Most of the major machine learning frameworks that have implemented that optimized code are developed with Python in mind as their user-facing language - in particular I'm talking about TensorFlow and PyTorch. I'm sure there are some Java wrappers for these frameworks out there, but these frameworks are still in rapid development and I'm not sure you could find the level of support for Java as you would for Python. On top of this, the data science community is largely biased towards Python and you won't be able to find as much help if you decide to foray into ML using Java.
Language loyalties are meaningless, it's always about the right tool for the job. There's a time and place for Java - particularly with the Apache big data ecosystem, but ML isn't it.