Tuesday, March 20, 2018

Artificial intelligence and Machine learning



Attended a meetup on AI and Machine learning conducted by Harinder.

https://www.meetup.com/All-About-Design-Patterns/events/248506302/


Short notes on same:

AI -> artificially created intelligence

Machine learning is an *important* approach to AI. (There are many approaches out there).

--
Some applications:

Why Candy crush was so famous ?

       According to the player's habits, the game adjusts itself to ensure that the player stays for long.

Facebook, Google maps etc., makes use of AI.

recaptcha -> use this to crowsource old book's scanning.

youtube suggestions

Spam  detection

Deep learning

Natural language processing.

---
John Mccarthy coined the term AI.  1959.

https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)


many developments followed especially games played by AI.

1997 -> Deepblue played chess
2005 -> self driving car
2011 -> watson jeopardy
2016 -> alphago game

Don't take games lightly :)

----------
2005 -> 135 Exabyte human data
Now -> 100,000 exabytes !!
(1 Exabyte -> 1000 PB -> 1PB=1000 TB -> 1TB=1000 GB)

So much of DATA and so  much of computing power, hence good interest now.
------------

Given x and y whose values are linear , AI can figure out
 y = mx+c
// slope and interceptor

Here, y=mx+c is the model figured out by AI.
It can use the model to get output for any input.

what if scatter plot ?

    make use of squares to get smaller numbers.

Fit the DATA -> important term

Fit the DATA to figure out the MODEL.


machine learning -> supervised
                             -> unsupervised

                              supervised -> regression
                                                 -> classification


supervised -> labelled.
unsupervised -> unlabeled.

Regression -> continuous output
classification -> well defined classes

Machine learning:

1. Fit

                  data -> learning -> model

eg: model -> y = mx+c
 
2. Predict
                 testdata -> model -> New value (prediction)


So, out of 30 test data

Use 20 test data get the model.

input 10 test data -> use model and get output
compare with actual output.

helps to know whether algorithm is good / bad.

model -> forumla / rules.

test data =================
                                                            -> test data accuracy
actual output   -----------------------


train data  =================
                                                               -> train data accuracy
actual output  -----------------------

(test data is part of train data)

Avoid over fitting (100% data accuracy).
(Remembered) data


4 important points in ML:

1. good data - data needs to be cleaned.
2. Algorithm
3. Features.
4. Parameter tuning.


AI framework :

https://www.anaconda.com/download

Machine learning in python:

http://scikit-learn.org/stable/







Friday, March 16, 2018

Check whether rpm signed or not


How to check whether rpm signed or not ?


rpm -K <your rpm file>

If signed, sha1 md5 OK

If not signed, md5 NOT OK (MISSING KEYS: XYZ.. )

Friday, March 9, 2018

install vagrant-libvirt


To install vagrant-libvirt:

vagrant plugin install vagrant-libvirt


Before the above command, need to run:

yum install libxslt-devel libxml2-devel libvirt-devel \  libguestfs-tools-c ruby-devel gcc -y

Thursday, March 8, 2018

OpenShift - select resources based on labels



Openshift :

Select resources based on labels:

oc get all --selector="testlabel_whateveryouhave"



Disable a specific node from scheduling in openshift



How to disable a specific node from scheduling in openshift?


root@dhcp43-231 ~]# oadm manage-node dhcp43-231  --schedulable=false
DEPRECATED: The 'oadm' command is deprecated, please use 'oc adm' instead.
NAME                                STATUS                     ROLES     AGE       VERSION
dhcp43-231   Ready,SchedulingDisabled   master    10d       v1.9.1+a0ce1bc657

[root@dhcp43-231 ~]# oc get nodes 
NAME                                STATUS                     ROLES     AGE       VERSION

dhcp43-231   Ready,SchedulingDisabled   master    10d       v1.9.1+a0ce1bc657


source: https://docs.openshift.org/latest/admin_guide/manage_nodes.html

Wednesday, March 7, 2018

checkout specific branch - github





git fetch upstream pull/<ID>/head:BRANCHNAME

// Where, ID the PR number


git checkout BRANCHNAME


git push upstream BRANCHNAME
// push the branch