The Algorithms of Artificial Intelligent

I'm new to Python programming and - actually - it just was started in the middle of 2020 for a specific corporate purpose where I'd worked at. So, I've been learned for couple months to explore what is what about Python, and - since there's no best fit guidance about machine learning methodologies - here I summarized about 17 common algorithms I found.

A. Supervised Learning

Split into 2 methods:

  1. Regression
    • Linear
    • Logistic
    • Polynomial
  2. Classification
    • K-Nearest Neighbors (KNN)
    • Decision Tree (DT)
    • Naive Bayes (NB)
    • Support Vector Machine (SVM)

B. Unsupervised Learning 

Split into 3 methods with 2 models (ML & DL):

  • Machine Learning
    1. Clustering
      • K-Means
      • Hierarchical Clustering
      • T-SNE Clustering
      • DBScan
    2. Dimension Reduction
      • Principal Component Analysis
      • Anomaly Detection
      • Auto-Encoder
      • Hebbian Learning
  • Deep Learning
    1. Generative Models
      • Generative Adversarial Network
      • Self Organizing Maps

I wrapped this post on a video I published in Youtube:

Thank you for your reading & subs. I'll update this post as soon as I found any of new algorithms.

Labels: ,

  Post a Comment

Importing Various CSV Datasource in Python

From previous post (https://paparadit.blogspot.com/2020/11/python-common-libraries.html), we learn how to deal with libraries in Python. On this post, I'm going to show you how to import CSV data using Python. I'll update this post as soon as I discover another way how to do it:

1. CSV from local computer

import pandas as pd
from google.colab import files
uploaded = files.upload()
import io
vlog96 = pd.read_csv(io.BytesIO(uploaded['vlog96.csv']))
vlog96.head()

2. CSV from GitHub

import pandas as pd
url = 'https://raw.githubusercontent.com/kokocamp/vlog96/master/vlog96.csv'
vlog96 = pd.read_csv(url)
vlog96.head()

You can see my video below to make a practice on how to import CSV files from local computer and GitHub.


3. CSV from Google Drive (#1)

The long way:

 import pandas as pd

# Code to read csv file into Colaboratory:
!pip install -U -q PyDrive
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials

# Authenticate and create the PyDrive client.
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)

link = 'https://drive.google.com/open?id=1-2lhLcwe9QNT8okL69QL_tV-O4BN9um6'
fluff, id = link.split('=')
print (id)
downloaded = drive.CreateFile({'id':id})
downloaded.GetContentFile('vlog98.csv')
vlog98 = pd.read_csv('vlog98.csv')
vlog98.head()

4. CSV from Google Drive (#2)

The simple way: 

import pandas as pd

from google.colab import drive
drive.mount('/content/drive')

path = '/content/drive/My Drive/data/vlog96.csv'
vlog96 = pd.read_csv(path)
vlog96.head()

I wrapped both way on a video below: 


For GitHub resource, you can use CSV from my account (https://github.com/kokocamp) on or you can make it your own.

Labels: ,

  Post a Comment

Python Common Libraries

Months ago, I wrote about my first blog post about Python (https://paparadit.blogspot.com/2020/07/python-for-dummies.html) - as technically I curious about how it works as a machine learning tools. On that link, you can learn (a very) basic Python codes including: (1) How to print out on screen? (2) Learn about variable assignment and data type, (3) Sequences operation, (4) Math operation, (5) Ask for input, (6) Branches, (7) Looping, (8) Array, (9) Quit from looping Function and that's all is a good start for you to learn Python syntax structures. I wrapped it all on 2 video series below.


 

On current post, I'm going to explain you about Python common libraries I used based on my experiment to create proof-of-concept of several machine learning algorithms. I'll try to update this post as soon as I found new library algorithm used on my code.

1. Matplotlib

 A main Python library purposed for graph visualizing.

import matplotlib.pyplot as plt

2. Numpy

A famous Python library for scientific computing.

import numpy as np

I bundled about how to using those Matplotlib and Numpy libraries in a single video below:



3. Pandas

Stand for Python for Data Analysis or some said as PANel DAtaS. It mainly used for data analytical.

import pandas as pd

4. Seaborn

Commonly used for Python statistical graph and strongly integrated with Pandas data structure.

import seaborn as sns

I packed about Pandas and Seaborn example in a video below:



5. Scikit

Mostly contains core statistical algorithms and powerful package to do high-performance linear algebra and array operation with Numpy.

from sklearn.<package> [import <sub_package>]

So, I hope you exactly know what you have to import before playing around with Python. And, remember one thing, "Don't code what you can't debug" :)

Labels: ,

  Post a Comment

Python for Dummies

For anyone who want to know Python and desired to learn it, so here I write down about what I'd remembered:
  1. Python are basically interpreter, the same way with HTML processing on browser since it executed line by line.
  2. Thanks to Google because they provide Python virtual environment so that everyone can use to learn it. First thing first, open https://colab.research.google.com/ from your browser and press New Notebook. Copy and paste the following syntax and have a fun modification :)
  3. How to print out on screen?
    print("Hello","World","?")
  4. Learn about variable assignment and data type:
    #int x = 0 #float y = 4.3 #string z = "z"
    x = 0
    y = 4.3 z = "z"
    print(x,y,z)
    type(z)
  5. Python is about sequences:
    a = 1 a = a + 1 b = 2 c = a + b type(c) c = str(c) print(c)
  6. Math operation:
    print(c*2)
    49**0.5
  7. Ask for input:
    print("Name?") name = input() print("Hi",name)
  8. Branches:
    print("Name?") name = input()
    if (name=="dodol"):   print("Hi",name) else:   print("I don't know u,",name)   print("Age?")   age = input()   print("Age",name,":",age)
  9. Looping:
    for num in range(1,4):   print(4-num)
  10. Array:
    daftar_nama = ["saya","kamu","dia","mereka","kita"] for angka in range(len(daftar_nama)):   print(daftar_nama[angka])
  11. Quit from looping:
    for nama in range(len(daftar_nama)):   print(nama)   if (nama==2):     break
  12. Function:
    def add(a,b):   return a+b
    add(3,2) 
      I wrapped it on 2 videos below if you want to make a practice:


    That's it for today. Happy Python!

Labels: ,

  Post a Comment