Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,159,732 members, 7,840,839 topics. Date: Sunday, 26 May 2024 at 03:47 PM

4kings's Posts

Nairaland Forum / 4kings's Profile / 4kings's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 97 pages)

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 7:56am On Apr 10, 2018
Darivie04:

So whats today's topic?
Today!!! wink
We would be looking at the inefficiency of the linear equation on a non evenly distributed dataset, therefore introducing the concept of optimisation or error functions and a look at multiple linear regression, then we'd write code for predicting stock market data.
Insha Allah... embarassed

2 Likes

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 7:16pm On Apr 09, 2018
Hey guys, been busy would continue the tutorial maybe this night when i get home.

By the way my images are not showing again, abi is it my laptop.

Can anyone recommend a good image sharing site, i'm using imgur and apparently it's no good.

1 Like

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 7:11pm On Apr 09, 2018
Na wa oo
Una still dey fight.
And who is this Alejob sef.
Seun please we need an active moderator abeg.


Anyways Omohayek cool achivements smiley
Have you thought of interwining the bellman's equation with bayesian approach? what's your view?

And how do you expect one to just come up with an answer for "how many neurons in a feed-forward architecture would it take to master pendulum-balancing in the OpenAI Gym environment", that isn't intuitive but only derived from data na.

By the way, Let's not fight again ooo
Just ignore anyone you don't like, so as not to derail the thread. That shouldn't be so hard. smiley

1 Like

Programming / Re: Python Programming by 4kings: 5:27pm On Apr 07, 2018
Damoxy:

Good Day,can we talk on WhatsApp?
I just sent you a PM. Contact me via mail.
Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 5:13pm On Apr 07, 2018
Samcent:
This is great! Following the lesson....
Darivie04:
@4kings what your doing is so informative I really appreciate it!!
Thanks guys. smiley
Programming / Re: Python Programming by 4kings: 3:49pm On Apr 07, 2018
efficiencie:
You guys started something as great as this and vanished ... shocked shocked shocked Wia una dey make una show o. I am a newbie to Python programming and I think posting and solving beginner python programming exercises would not only go a long way in keeping this thread alive but will spur the growth in the skills of new python programmers...Problem solving will keep this thread alive.

I saw this problem on a python programming facebook group (tis for newbies anyway):

Construct a python program that returns the number of occurrences of a substring in a string if the string does not end with the substring or returns one less of the number of occurrences of a substring in a string if the string does end with the substring.

For example, the solution must return 2 in the string 'adedasaasfdfdfsds' if the substring is 'fd' or the solution must return 4 if the string is 'adddddffggdd' and the substring is 'dd'. Note that in the last example 'dd' occurs 5 times in the string as it appears 4 times in 'ddddd' and once in 'dd' but this last count is disregarded since the specified string ends with 'dd'.

You are only permitted to use: LOOPS, CONDITIONAL STATEMENTS, BREAK, CONTINUE, USER DEFINED FUNCTIONS OR GENERATORS.
I don't understand this part: "or returns one less of the number of occurrences of a substring in a string if the string does end with the substring."
Programming / Re: Python Programming by 4kings: 3:32pm On Apr 07, 2018
Damoxy:
Is any body into Big Data Analysis or someone Good with R language?
Yep.
Watsup?
Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 2:56pm On Apr 07, 2018
Okay.
So we've used the linear equation to demonstrate how to generate a model to learn pattern in a dataset and make predictions.

But the dataset i used was too simple and just to give a simple introduction to linear regression.

Most dataset in the real world are not evenly distributed like our dataset, therefore we would encounter errors but how do we optimise our functions to deal with these errors?
Moreso, dataset usually have more than one independent variables.

We would deal with all these soon. And we would use stock market data for stock price prediction with linear regression. smiley



In the mean time, here's a 7 minutes simple video if you need to know how to proof y=mx + b.
I believe the video is simple to understand.
However if you don't understand any concept, you can always ask question for clarification.

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

1 Like

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 2:52pm On Apr 07, 2018
Hey guys, so i said i’ll be initiating explanatory tutorials occasionally on the details behind most machine learning algorithms in order for us all to understand and make research especially as we progress in this group.
I say *initiating* cos everyone should contribute.

We would of course be applying these machine learning algorithms to areas of Artificial intelligence like computer vision, natural language processing, bioinformatics, stock market prediction and many more.

Hope this would turn out fun and useful.
Contribution by all is encouraged. smiley
And remember to always ask questions if you not clear about a concept, no question is nonsense.



Well here i start smiley :

Look at this data:



It tells what wage a person recieves based on the time(in hours) put to work.
With this naive data we can by intuition after looking at it for a while see and predict what a person wage would be given a value of the total time he/she spent working.
We know this because after looking for a while we can see a pattern that the wage increase by 75000 as time increase by 10. wink

But how can a computer know this pattern and make prediction, without being explicitly programmed.

And this is where we look at Regression algorithms.
Regression algorithms: are used to study relationships between two or more continuous variables and generates a model used for prediction.
“Continous variables” in the sense that wages in our small dataset are of different values and cannot be represented in discrete form like 1 and 0 or True and False. As such the data we are exploring is a regression problem.

There are many algorithms for regression but we would look at linear regression for now.
Linear Regression:
Linear regression is divided into 1) SImple Linear Regression and 2) Multiple Linear regression.

Simple linear regression deals with one independent variable, like in our dataset.
Multiple linear regression deals with more than one independent variables.

For our dataset the dependent variable is the label or target(Wages) and the independent variable is the feature(which is Time[in hours]). So in any dataset the label is the dependent variable and the independent variable are the features. → Features determine what the label would be. Dig it?

So let’s take a look at simple linear regression;
Simple linear regression deals with the linear equation in mathematics were the features in a graph are connected or fitted by a line as much as possible.

To understand linear equation let’s examine this sample graph:



Things to note:
a) The obvious ones: there are two axis the vertical is Y-axis and the horizontal is the X-axis.

b) In the graph above the direction of the line at any two points is called the SLOPE or GRADIENT(actually in deeper details this two are a little bit different but we would get there).
The gradient is usually represented with the letter m in maths.

c) The INTERSECTION is where the line cuts or intersect on the y axis. This is usually represented as b or c.

The formula for the linear equation is Y = mx + b
m and b is explained above. Y and X are the points on the axis to represent the values of our dataset. So given a value x we would be able to predict y.

If you want to be able to proof or derive this formula yourself i’ll discuss it in the next post. smiley

So let’s plot the graph for our dataset:



From the images above. The first graph are the unconnected points(called scatter plot) of the values in our dataset, while the second graph is the line fitting the points and the linear equation is useful for fitting this line to our dataset points and for prediction.

Making Prediction:
So let’s write the code for the linear equation and also to predict a wage(y) given a time(x).
So given a time(x) as 70 we need to predict what y(the wages) would be.
Y = mx + b

The gradient m is denoted as rise/run. Meaning the difference of any two points on the y axis divided by the difference between the corresponding points on the x axis. (Like i said the proof and derivative of this formula would be discussed in the next post)
I usually take the last two points, therefore:
(450000 - 375000) / (60-50)
=> 75000/10 = 7500
Therefore the gradient of our small data points is 7500.


B is the intersection. SInce in our graph it’s not noticeable we can derive b using simple math.
If y = mx + b:
Then when y = 75000 and x = 10 then:
75000 = (7500 * 10) + b
75000 = 75000 + b
75000 - 75000 = b
Therefore b = 0. Meaning the points in the dataset are evenly distributed.

So for our prediction, when time(x) is 70 then wages(y) would be:
Y = mx + b
Y = (7500 * 70) + 0
Y = 525000 + 0
Y = 525000

So our algorithm(the linear equation) has predicted that when the time(x) is 70 then the wages(y) would be 525000.

Remember when looking at the dataset, our Wages increases by 75000 as time increase by 10. Therefore our algorithm has accurately derived the pattern and predicted the wage correctly. cool

This simple illustration is not all for linear regression yet, but a demonstration of how mathematical modelling is used to derive pattern and make a model for prediction on dataset

So here’s the code for linear equation and making prediction based on our dataset. (the code is well commented to follow through)
I’ll prefer you(that’s if you didn’t know this already) to not look at the code and write it yourself to cement your understanding of the equation.

#Code:
#This is a python library for plotting of graphs.
from matplotlib import pyplot as plt

#Make variables for our dataset with their values ordered appropriately
time = [10, 20, 30, 40, 50, 60]
wages = [75000, 150000, 225000, 300000, 375000, 450000]

#Code for plotting the graph of the dataset.
plt.plot(time, wages) #Use plt.scatter to see the scatter plot instead.
plt.yticks(wages)
plt.xlabel('Time(in Hours)')
plt.ylabel('Wages(Naira)')
plt.show()


#define function for the linear equation (y = mx + b)
#The linear equation function should take additional argument x to be used for prediction.
#data1 and data2 represents time and wages.
def linear_equation(data1, data2, x):
#remember how to derive m.
#here we used the last two points on the x and y axes.
# (y2 - y1)/(x2 - x1)
m = (data2[-1] - data2[-2]) / (data1[-1] - data1[-2])

#Remember how to get b, by substituting the corresponding values for a point(x,y).
#Use the last values for x and y also for simplicity sake.
#b = y - mx by substitution.
b = data2[-1] - (m * data1[-1])

#therefore to predict y given the argument x:
y = (m * x) + b
return y

#Like in the explanation:
#To predict wage(y) when time(x) is 70:
#Call the function with the argument for x also putting the two intial arguments for the dataset.
predict = 70
result = linear_equation(time, wages, predict)
print("The wage prediction when time is {} is:".format(70), result)

1 Like

Programming / Re: The Best Programming Language Is... by 4kings: 2:46pm On Apr 07, 2018
Ejiod:

Same as me! I hate java not because I Dont know it but due to its awkward learning curve
The language is annoying to work with.
Programming / Re: How To Pick A Language For That Next Project by 4kings: 12:48pm On Apr 07, 2018
seunthomas:
I am going to be writing a series on how to pick a language for that next project.

Most times the wrong programming language or stack may mean we spend more time on a project than necessary.

So how really do you pick your stack for that next project.

Please note i will only continue this thread if i see interest.
Where art thou?
Programming / Re: The Best Programming Language Is... by 4kings: 12:46pm On Apr 07, 2018
Seunthomas if i had to choose one i would go with C.

C is also very clear and simpler than C++
Ya it's not as elegant as python language though. But most popular python libraries and softwares(tensorflow, numpy, scipy, Blender3d, Cinema4d and many more) are powered by C or C++ because of speed and doing otherwise would be a disaster.

Python is my favorite programming language but if i had to choose the best for all tasks i would go with C.

P.s Java is a very useless language. Bite me. tongue tongue

3 Likes

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 12:34pm On Apr 07, 2018
MYSELF2018:
Thanks a lot my brother
You welcome.
How far have you gone with the research or have you switched to another?
Programming / Re: Internship Position by 4kings: 12:32pm On Apr 07, 2018
seunthomas:

Non for now. But do send your info and we will contact you when such openings are available. Who knows Nigeria may produce the next version of SIRI,Google Now,Alexa...
Hmmm. Hope so.
Programming / Re: Friendzone by 4kings: 6:04pm On Apr 05, 2018
Jenifa123:

nope
Something's wrong.
chat me up and see if it goes through.
Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 5:25pm On Apr 05, 2018
Aceed:



Open to interpretations in that some folks might just read my reply alone without reading your post that was quoted but I don't doubt the clarity of the message when anyone reads my reply in relation to your post
"Anyone" but ME alone. undecided
Kontinue...

1 Like

Programming / Re: Friendzone by 4kings: 5:21pm On Apr 05, 2018
Jenifa123:

try it again
Nope, still taking back to the login page after clicking post or hitting enter.

Did you see the message i sent you?
Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 3:29pm On Apr 05, 2018
Aceed:


Simple English is short of words to express my reply but the reply I gave you was apt and complete.

It may be open to interpretations but the message is clear. VERY CLEAR.

Not everyone understands English though, so I understand your predicament.
Are you seriously mocking my comprehension after making this contradictory statement:
It may be "open to interpretations" but the "message is clear". VERY CLEAR.
undecided

1 Like 1 Share

Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 3:07pm On Apr 05, 2018
mattbass:
The last time i checked CU was and still a private university and not government owned. So the owner can decide to enact rules that will suit his own style.
*human right*

1 Like

Programming / Re: Friendzone by 4kings: 2:45pm On Apr 05, 2018
Jenifa123:

at d newsfeed?
Ya. Wanted to make an extra comment on your post and the next post by "bc", but couldn't. embarassed embarassed
Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 2:41pm On Apr 05, 2018
osarenomaspecial:

taking fundamentals of machine learning will be great at this point is what we need now in the thread.
Great!!!
Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 2:41pm On Apr 05, 2018
Aceed:


Matthew 3:9 - And think not to say within yourselves, We have Abraham to our father: for I say unto you, that God is able of these stones to raise up children unto Abraham.



Luke 19:40 - And he answered and said unto them, I tell you that, if these should hold their peace, the stones would immediately cry out.


My opinion though
This is open to interpretations.
What do you mean in simple english?

1 Like

Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 2:39pm On Apr 05, 2018
ireneidiva:

You kept going round and round. You ended up saying nothing.
Okay.
Was talking to someone though, didn't know it would enter frontpage.

Anyways what you understood or misunderstood is not my concern.

2 Likes

Programming / Re: Friendzone by 4kings: 1:23pm On Apr 05, 2018
Jenifa123:

and yes all the sections will be active by the time m done
I've not been able to make a post for 3 days now.
Whenever i try it gets me back to login page.
Though i made two posts about 3 or 4 days ago, but not ever since. embarassed embarassed embarassed

Tried with mobile version also, but to no avail.
Education / Re: Oyedepo In His Own Time: Throwback Haircut Hypocrisy And The Rights Of The Olori by 4kings: 1:08pm On Apr 05, 2018
HigherEd:
The overzealousness is really coming from the staff and not necessarily the church.
Lalasticlala
Hmm. To an extent true.
But Oyedepo still have issues with keeping of hair.
You must be dressed like Kings and Queens. Lol smiley

This is what i was saying about encouraging most of their students(especially undergrad) into research.
Most of their current achievements are by lecturers and some post grad students.

This semester a programmer working in Hebron startup lab was sent out cos of hair(when they don't even have up to 5 competent ones active there). When i was in school I never even entered that startup lab once, the dreamers committee by the former VC did not have a competent team even the startup lab till now have not really done anything significant since inception.

The guys excelling 3d modelling/simulation, programming, machine learning visual effects and other fields needed in Bioinfromatics, startuplab and other departments are MOST of the time not the ones that speak in toungues for hours in H.O.D ground at chapel but the guys that are being oppressed for silly issues like Jump trousers, hair, not bringing of bibles, 2 minutes late to chapel and seizing of id cards and other drama in that school.

Most of these initiatives that have been taking by the school are not sought after by all, cos there is a general perception most students have about things relating to names like "student council", "dean", "VC" and so on.

My work in the Programming school, BioInformatics and Startup lab was based on a relationship with a roommate in CU if not i wouldn't have known CU had interest in those things and they don't have much hand but consult at expensive prize when they are students availabe to work or research on most of these things.
But the school has made most students to worry about what should not be and not to be participative in some key areas.

Not sure how many people goto CUCRID meanwhile they are lots of opportunities there to make for a very innovative environment amongst students in CU not lecturers only. But again CU policy affecting the perception of most students.

Just my thoughts though.

18 Likes 1 Share

Programming / Re: Network Simulator Tool Assignment by 4kings: 12:05pm On Apr 05, 2018
Alimy were you able to get your assignment done.
What was it about?
This would have been interesting. smiley
Programming / Re: Internship Position by 4kings: 11:50am On Apr 05, 2018
seunthomas:
The internship application will be open till 9th April,2018 (6pm).
The BOSS cool
You still dey nairaland. Thank God.
Is there internship position for data science/machine learning? smiley smiley

1 Like

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 11:44am On Apr 05, 2018
SoftEng:
Hi all,

Here's another competition that might be of interest to you.

Microsoft Cloud AI Research Challenge.
https://www.microsoft.com/en-us/research/academic-program/microsoft-cloud-ai-research-challenge/

The Challenge
Use Microsoft AI services to develop (breakthrough) applications or embed their AI (cognitive) services into your application.
Prize: 25,000 USD Grand Prize

My take on the challenge
In simple terms, Microsoft wants to encourage more developers to use their AI platform and also discover new use cases of AI from these challenge. I believe it is a fun and interesting challenge. For anyone who will be interested, you can think of wide variety of application areas, but if you can narrow it down to application areas that solves some of our local problems that would be a good thing.

Thanks.
9 days left.
Reminder.
smiley embarassed embarassed
Programming / Re: G I S Expert Come In by 4kings: 11:27am On Apr 05, 2018
shams040:
hi
Hmmm.
Wanna discuss anything in particular about GIS?
Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 11:16am On Apr 05, 2018
Darivie04 welcome!!! smiley
It's very cool that you are in JSS3 and are tackling machine learning. That's dope. cool

Anyways, a while back i spoke with raymod170 offline about taking fundamentals of machine learning.
That is explaining the maths behind most algorithms in simple details instead of using libraries without understanding what's going on under the hood as that impedes the capability to understand and make research in this field.

I've been busy, but would put it in my schedule to explain the details behind most machine learning algorithms in simple details including reinforcement learning, occasionally on this thread. smiley

1 Like

Programming / Re: Artificial Intelligence And Machine Learning Group by 4kings: 11:14am On Apr 05, 2018
What nonsense happened here...
Guys let's not derail this thread.
We can all learn and be of help to one another.
No need to fight over trivial matters abeg...


Seun Mynd44 Lalasticlala and the mods of this section(if they are still alive; Javanian kodewrita and lordZOUGA ) please help delete some of the comments they are so cringy.
Celebrities / Re: Segun Ogungbe With His Two Wives On His Birthday (Photos) by 4kings: 1:40pm On Apr 02, 2018
delishpot:


Because God was supposed to outrightly protect them which he used to do in the past eg. Shedrach mishack and abdnego, Daniel, the angel of death killing the enemies at night while they slept encamping Gods children, crossing the red sea, the plagues of egypt etc. Those days they did not have to fight. God used to do it himself. Only God knows when that stopped and they started doing their battles by themselves with the help of a priest who acts as a middle man between them and God. I believe they were so bad that God turned away and abbandoned them but God communicated with some who were obidient and those were the middle men who helped the jews to ask Gods fabour when they go out to war or hussle. Just my own opinion.
Hmm, there is an issue.
Because these additional laws started during Moses' time and God didn't fight most of their battles then.

Anyways, the Bible(and most religions) is not always clear.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 97 pages)

(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. 64
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.