-
0
Question: How complicated is it to create a machine learning program or device?
- Keywords:
-
Andrew Maynard answered on 10 Jan 2024:
It depends. If you are building it from scratch, it takes a lot of knowledge of the math, science and coding behind machine learning, plus access to powerful compute facilities. If you are using existing systems and platforms, it’s a lot less complicated. And if you’re creating a simple app using ChatGPT for instance, it’s very easy.
-
Carl Peter Robinson answered on 10 Jan 2024: last edited 10 Jan 2024 5:22 pm
From my and my team’s point of view, sometimes it’s really easy to build a machine learning program, using existing code and models that we can then change to suit our needs. Other times, we might need to go deeper, to create our own models and pipleines, which can involve understanding the mathematics behind how they work. This can make things more difficult.
Additionally, the most important part of the machine learning process is making sure the data you use is in the most appropriate state it can be before using it with your model. If that dataset is also quite large, we have to consider how much available computing power we have to run the model training process and whether we can do it in a reasonable amount of time.
As a slightly more detailed response, if you’re interested:
It depends at what level you want to come in at. What you will need is a basic understanding of the machine learning workflow. In basic terms it follows this kind of process (this is not the absolute way of doing it, so don’t believe it has to follow this exact method):
1. Start with getting some data that you want to use for your machine learning project.
2. Process that data into a state such that it can be used as input for a machine learning model. This includes splitting the data into a training dataset, validation dataset, and test dataset.
3. Choose a machine learning model to work with, either an existing one, or you can create one of your own.
4. Train and evaluate the model with your training dataset and validation dataset. Keep doing this until you get a final model state that you are happy with (i.e., a model that gives good results in your opinion).
5. Test how well your model works by giving it the test dataset and observing the results.From here, there are a whole heap of tutorials online that show you how to develop a machine learning project, mostly using the Python programming language (If you are interested, this site helped me a lot while I was doing my PhD: https://machinelearningmastery.com/start-here/).
It’s a good idea to have a basic understanding of Python and again, there are a whole host of online tutorials for learning that too. There are also whole books available online that work through examples (going through those steps 1 to 5 that I stated above, and maybe more steps depending on the process they are using).
There are other ways of creating machine learning applications, without needing to write any code, but that’s not what I will focus on with this answer.
There are several machine learning specific libraries and tools you can use to develop your machine learning code: TensorFlow and PyTorch are the main ones, but I have also found Keras (which is an application programming interface (API) for TensorFlow) makes it really easy and quick to create your own machine learning models. You will likely have to install one of these on your PC, and additional drivers to utilise your PC’s GPU if it has one (e.g., CUDA drivers).
I could wibble on about this topic for days, but I hope this somehow manages to answer your question.
-
Kevin Tsang answered on 10 Jan 2024:
I’ll give an example of creating a very simple machine-learning program to predict the fruit given some information about its colour and weight. This will use the R programming language and just 5 lines of code which you can see below.
To describe the 5 lines of code:
1) We will build on the shoulders of giants, so we will use some code that other developers have written to train machine learning models.
2) We have 10 fruits in our fruit bowl and we write down the colour of each fruit and measure the weight, this is our data. There are some watermelons, some grapes, and some bananas.
3) We give our data about fruits to the machine learning (decision tree) program to learn
4) We now have a new fruit, which is yellow and weighs 100 grams
5) The machine learning program predicts that this is a bananaIt turns out that this is incorrect, our fruit was in fact a lemon, but our AI hasn’t seen a lemon before, so it thought all yellow fruits were bananas. To make our AI better, we need to give it more data about the world so it knows about all fruits, and we can give more data about different aspects of the fruit, such as shape and taste.
—- Code to build AI —-
# 1) Load the rpart package, which is code written by others that we can use
library(rpart)# 2) Some data about the colour and weight of fruits in our fruit bowl
fruit_df <- data.frame(
fruit = c("watermelon", "grape", "banana", "banana", "grape", "banana", "banana", "grape", "banana", "watermelon"),
color = c("green", "green", "yellow", "yellow", "green", "yellow", "yellow", "green", "yellow", "green"),
weight = c(15, 0.005, 0.11, 0.12, 0.004, 0.09, 0.08, 0.006, 0.07, 16)
)# 3) Fit a decision tree model, an example of machine learning
tree_model <- rpart(fruit ~ ., data = fruit_df, control = rpart.control(minsplit = 1))# now the model knows green and heavy is a watermelon, yellow and light is a banana, and green and light is a grape
# 4) Make a prediction for a fruit that is yellow and weighs 0.1kg
new_fruit <- data.frame(
color = "yellow",
weight = 0.1
)predict(tree_model, new_fruit)
# 5) The AI model says it is a banana
-
Alexander Coles answered on 11 Jan 2024:
As others have pointed out, the math behind AI can be quite complex, and understanding this could be considered hard in that it took us all probably years of training to understand.
However, most of us also use pre-existing code that does all this math for us. In fact, most programming in all fields borrows and uses code that has been written by others. I like to think of it with the metaphor of a builder. Builders use bricks made by others to create buildings in different styles. In the same way, we programmers use code that comes in a “package” and we stick it all together to create our own programmes which do a specific task.
To find these packages of code that have been written by others, we spend a lot of our time googling and using a website called StackOverflow where programmers ask for help with their code. In fact, we do this day in and day out, but we like to think it’s a secret sssshhhh.
Related Questions
Latest Questions
-
Do you think in the future we will have AI healthcare and doctors? (1 Comment)
-
How do you believe advancements in artificial intelligence can specifically enhance or revolutionize diagnostic
-
how does chat GPT work?
-
will ai be able to create fully finished websites
-
If I make a sentient AI from scratch and let it know I’m it’s creator, will it respect me more than everyone else?
-
Does anyone have anything they wouldn’t mind sharing about astronomy or any interesting facts about AI
-
Who influenced you to do your Scientific research and how did they?
-
Why did you do AI instead of chemistry or biology’s and physics ?
-
I’ve always wanted to know how Artificial Intelligence works. I strongly agree that it can be a big help one day but
-
What artificial intelligence was the best one you have made (what did it do)
Comments