Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,377 members, 7,800,758 topics. Date: Thursday, 18 April 2024 at 05:58 AM

Survey - People Interested In Artificial Intelligence And Machine Learning - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Survey - People Interested In Artificial Intelligence And Machine Learning (5433 Views)

Opportunity For People Interested In App Development, Web Design, Etc. / Are You Interested In Robotics And Artificial Intelligence? / Artificial Intelligence And Machine Learning Group (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Survey - People Interested In Artificial Intelligence And Machine Learning by SoftEng: 9:42pm On Dec 10, 2017
themonk:
Lets go there. I'm higly intrested.
Please as a suggestion, could you mention all intrested persons when you start or can we use a platform like whatsapp. I just need to be duly notified on each update, thats all. Thanks alot

Sure thing. we can do that when the thread for the group is created.

With regards to platform, I believe it should be the decision of the group when created.

Thanks.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by SoftEng: 9:44pm On Dec 10, 2017
4kings:
*coughs*
The day has come. smiley

smiley
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 11:50am On Dec 11, 2017
SoftEng:


Well, let's see how it goes.
Additionally, different projects can be proposed by different persons (and these projects can be worked on by groups of persons in the community). Therefore, with such system, I hope everyone will have a part to play.

Anybody can put up an idea for a project on the group, with the hope that discussions are organically grown around the project and then these discussions may lead to actual implementation via collaboration by interested members of the group. From this perspective, it means that it's possible for the group to have different projects at an instance in time.
INTERESTING!!!
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by SoftEng: 12:54pm On Dec 11, 2017
The survey is now closed. We have a total of 17 persons (18 if I include myself) that indicated their interest in the formation of the AI/ML group.
Thanks for everyone who showed interest. If anyone else is interested in the group, please feel free to jump right into the new thread and introduce yourself. I'll put a link to the new thread here when it's created.

I'll create a thread here on nairaland for the group and will cc (mention) interested person on that thread. We can then discuss on that thread how to proceed and what platform (e.g. nairaland, whatsapp, google group, slack etc) will be preferable.

Recall some important points as stated earlier:
Important Points to Note
a. I'm not here to teach you about AI/ML. No, it's not a one sided thing. We all contribute and learn from each other about the current AI/ML projects/research that you're are working on. The aim is to foster a community of AI developers/researchers in Nigeria.

b. We will focus on Modern AI and its application rather than classical AI systems.


Thank you all.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by EbonyMira(f): 4:04pm On Dec 11, 2017
4kings:

That's interesting...
I sure can help, but let me wait for da boss to log in.

Do you understand the concept behind KNN first of all?

I dont fully understand it as a whole, but I know that it has to do with plotting points on a graph. you also plot an unknown point (k) and find its nearest neighbours(usually odd : 3,5 for small data sets). The maximum neighbours matching k is the solution.

E.g. If there are 4 bags in a basket. 3 are branded gucci, versace, and D n G. The fourth is left unclassified. Our problem is to place a brand on the fourth bag.

We first look at the features of each bag - shape, size, leather, color, quality, firmness, tailoring seam. We use this data to plot a graph on an x, y coordinate system (We over simplify the problem set). Then, we get the features of the fourth bag and plot it on the same graph. We assume a number K and draw a line from 4th plot to k. The nearest neighbours along this line tells us which brand bag four belong to. Ideally, the number of bags will be more than four for this to work. I take corrections, please educate!
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 10:55pm On Dec 11, 2017
EbonyMira:


I dont fully understand it as a whole, but I know that it has to do with plotting points on a graph. you also plot an unknown point (k) and find its nearest neighbours(usually odd : 3,5 for small data sets). The maximum neighbours matching k is the solution.

E.g. If there are 4 bags in a basket. 3 are branded gucci, versace, and D n G. The fourth is left unclassified. Our problem is to place a brand on the fourth bag.

We first look at the features of each bag - shape, size, leather, color, quality, firmness, tailoring seam. We use this data to plot a graph on an x, y coordinate system (We over simplify the problem set). Then, we get the features of the fourth bag and plot it on the same graph. We assume a number K and draw a line from 4th plot to k. The nearest neighbours along this line tells us which brand bag four belong to. Ideally, the number of bags will be more than four for this to work. I take corrections, please educate!
Ya, you very close. wink
Take a look at the quick image i made below.


Assume, the blue, green and yellow are features for Gucci, Versace and D&G respectively.
And the grey point is the test data we need to classify.

Then as you can see from the second image above, the nearest neighbor in the dataset is green(Versace). And K=1 because we are assuming the first nearest neighbor is our classifier.

But when K=3, the data would be classified as yellow(D&G) since it has the highest nearest neighbor.

Finding Nearest Neighbor:
To find closest neighbor or closest distance we can use different distance metrics.
There are many distance metrics such as Cosine Similarity, Euclidean Distance, Mahattan Distance, Minkowski distance and so on.
Finding the right distance metrics to use is an issue on its own so i won't touch that now.

This is the mathematical formula for cosine similarity:


The python implementation is:

import numpy as np
def cosine_similarity(x, y):
dot_product = np.dot(x, y)
norm_x = np.linalg.norm(x)
norm_y = np.linalg.norm(y)
return dot_product / (norm_x * norm_y)

I'm not sure what programming language you use, but if you use Matlab or Octave then the above should also make sense to you.

Normalization is same as np.sqrt(np.sum(x**2)) or math.sqrt(sum(x**2))
x and y are your feature vectors.

For Euclidean Distance:
This is the formula:


Very simple and is the most used(at least from what I've observed so far).
The python implementation should be:
import numpy as np
def euclidean_distance(x,y):
return np.sqrt(np.sum((x-y)**2))


So the steps to write a K-Nearest Neighbor code from scratch are:
1) Get you data-sets X and y. (training features and test data)
2) Choose K. (Number of nearest neighbor to identify)
3) Using the test data write a function that calculates closest distance based on any distance metrics you choose and choose the group it belongs.
----That is get first distance value and also get whether it belongs to yellow, blue or green and continue.
----This depends on how your datasets is arranged, either in a dictionary or sublists or whatever.

4) Sort your result from lowest to highest distance.
5) then slice your result based on K.
----For instance is K =3, and your result is a list variabe. Code will be --> result[:K]

6) Then get the highest number of groups in the new variable.

7) And voila there you go.

I think with these you can implement the code yourself. wink



Parameter Optimization:
- The best value for K is usually determined by cross-validation. That is testing each value for K to get the optimal result.(this is computationally expensive but helpful though)
--- Generally the most used method is k = n^(1/2)

Distance metrics: well this is where statistical skill really come to play.

I didn't want to just write the complete code, but if you don't get the explanation i made while implementing your code you can quote me.

This lecture from MIT should also give you a better explanation.

https://www.youtube.com/watch?v=eg8DJYwdMyg&t=404s
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by EbonyMira(f): 8:30am On Dec 12, 2017
4kings:

Ya, you very close. wink
Take a look at the quick image i made below.


Assume, the blue, green and yellow are features for Gucci, Versace and D&G respectively.
And the grey point is the test data we need to classify.

Then as you can see from the second image above, the nearest neighbor in the dataset is green(Versace). And K=1 because we are assuming the first nearest neighbor is our classifier.

But when K=3, the data would be classified as yellow(D&G) since it has the highest nearest neighbor.

Finding Nearest Neighbor:
To find closest neighbor or closest distance we can use different distance metrics.
There are many distance metrics such as Cosine Similarity, Euclidean Distance, Mahattan Distance, Minkowski distance and so on.
Finding the right distance metrics to use is an issue on its own so i won't touch that now.

This is the mathematical formula for cosine similarity:


The python implementation is:

import numpy as np
def cosine_similarity(x, y):
dot_product = np.dot(x, y)
norm_x = np.linalg.norm(x)
norm_y = np.linalg.norm(y)
return dot_product / (norm_x * norm_y)

I'm not sure what programming language you use, but if you use Matlab or Octave then the above should also make sense to you.

Normalization is same as np.sqrt(np.sum(x**2)) or math.sqrt(sum(x**2))
x and y are your feature vectors.

For Euclidean Distance:
This is the formula:


Very simple and is the most used(at least from what I've observed so far).
The python implementation should be:
import numpy as np
def euclidean_distance(x,y):
return np.sqrt(np.sum((x-y)**2))


So the steps to write a K-Nearest Neighbor code from scratch are:
1) Get you data-sets X and y. (training features and test data)
2) Choose K. (Number of nearest neighbor to identify)
3) Using the test data write a function that calculates closest distance based on any distance metrics you choose and choose the group it belongs.
----That is get first distance value and also get whether it belongs to yellow, blue or green and continue.
----This depends on how your datasets is arranged, either in a dictionary or sublists or whatever.

4) Sort your result from lowest to highest distance.
5) then slice your result based on K.
----For instance is K =3, and your result is a list variabe. Code will be --> result[:K]

6) Then get the highest number of groups in the new variable.

7) And voila there you go.

I think with these you can implement the code yourself. wink



Parameter Optimization:
- The best value for K is usually determined by cross-validation. That is testing each value for K to get the optimal result.(this is computationally expensive but helpful though)
--- Generally the most used method is k = n^(1/2)

Distance metrics: well this is where statistical skill really come to play.

I didn't want to just write the complete code, but if you don't get the explanation i made while implementing your code you can quote me.

This lecture from MIT should also give you a better explanation.

https://www.youtube.com/watch?v=eg8DJYwdMyg&t=404s



Thanks for the explanation. I am familiar with python, but I currently work with Javascript - nodejs. I hope we would be able to work together.

1 Like

Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 10:13am On Dec 12, 2017
EbonyMira:


Thanks for the explanation. I am familiar with python, but I currently work with Javascript - nodejs. I hope we would be able to work together.
Okey-dokey.
We all would work together, that's the vision of SoftEng.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Nobody: 6:55pm On Dec 12, 2017
Hey guys, I'm interested in machine learning but I have zero knowledge apart from its definition.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by NaHiim: 11:21pm On Dec 15, 2017
@SoftEng. Now what next?
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 9:10am On Dec 16, 2017
Unmarshalled:
Hey guys, I'm interested in machine learning but I have zero knowledge apart from its definition.
Let's wait for SoftEng.

You can start with some courses from MIT OpenCourseWare.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Nobody: 10:17am On Dec 16, 2017
4kings:

Let's wait for SoftEng.

You can start with some courses from MIT OpenCourseWare.
OK tanx
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by SoftEng: 6:31pm On Dec 16, 2017
@4kings, @Unmarshalled and @everyone. I apologise for the delays.

Since we have more than 10 persons interested in the group, I'll go ahead an create a thread now on Nairaland as earlier stated.

@4kings thanks for your inputs so far.

1 Like

Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Omoadeola(m): 6:35pm On Dec 16, 2017
I am also interested.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 6:47pm On Dec 16, 2017
SoftEng:
@4kings, @Unmarshalled and @everyone. I apologise for the delays.

Since we have more than 10 persons interested in the group, I'll go ahead an create a thread now on Nairaland as earlier stated.

@4kings thanks for your inputs so far.
Atlast. smiley
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Nobody: 6:50pm On Dec 16, 2017
Waiting for d thread.. I'm thrilled grin
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by SoftEng: 7:24pm On Dec 16, 2017
The new thread for the group has now been created.
Visit here https://www.nairaland.com/4237475/artificial-intelligence-machine-learning-group.

This survey thread is now closed.

Thank you.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by lydia4211(f): 8:55pm On Dec 16, 2017
Interested
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by odizeey(m): 5:34pm On Dec 23, 2017
Im interested
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by 4kings: 5:38pm On Dec 23, 2017
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Horus(m): 11:16am On Jun 09, 2018

https://www.youtube.com/watch?v=RzG8LQ4Ntuw

Data Science Nigeria Opens First Nigerian Artificial Intelligence HUB in UNILAG

Data Science Nigeria in furtherance of its drive to boost research and innovation in Nigeria, opened the first ever
Nigerian Artificial Intelligence Hub in the University of Lagos.
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by UNNPride: 11:48am On Jun 09, 2018
AI-infused mobile apps give marketers a complete understanding of user behavior and help refine the entire journey by delivering value at every step of the way.

It sifts through a huge number of data points to isolate actionable insights that’ll pave the way for a more meaningful relationship with the customers.

https:///BTuje4
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by simplymorgan: 8:54pm On Jun 14, 2018
I'm interested...
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Diamondwriter(m): 12:57pm On Jun 15, 2018
interested
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Bigboy289(m): 1:02pm On Jun 15, 2018
am interested
Re: Survey - People Interested In Artificial Intelligence And Machine Learning by Edufresh(m): 6:13pm On May 28, 2019
I am very much interested

1 Like

(1) (2) (Reply)

Web Development Using Java / Puzzle of the day / [problem] Write A Program In C++ That Finds The Hcf Of 2 Numbers Without Using A Recursive Function

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 48
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.