Code Monkey home page Code Monkey logo

tucil02-stima's Introduction

Logo

Implementasi Convex Hull untuk Visualisasi Tes Linear Separability Dataset
dengan Algoritma Divide and Conquer

Tentang Project

Project berisi Library myConvexHull dalam bahasa Python yang dapat mengembalikan convex hull dari kumpulan data 2 dimensi (dapat dianggap kumpulan titik 2 dimensi). Himpunan titik pada bidang planar disebut convex jika untuk sembarang dua titik pada bidang tersebut (misal p dan q), seluruh segmen garis yang berakhir di p dan q berada pada himpunan tersebut. Kompleksitas rata-rata mencari Convex Hull dengan menggunakan algoritma Divide and Conquer adalah O(n*log(n)), sedangkan dalam kasus terburuk kompleksitas rata-ratanya adalah O(n^2)

Data set yang diimplementasikan :

Requirement

  • python
  • math
  • numpy
  • matplotlib
  • pandas
  • random
  • sklearn

Menjalankan Dataset yang lain

  1. Copy Paste bagian dibawah

    # Load Dataset
    data = datasets.load_<nama_data_set>() # diisi oleh nama data set
    df = pd.DataFrame(data.data, columns=data.feature_names)
    df['Target'] = pd.DataFrame(data.target)
    
    # Plot 
    plt.figure(figsize = (10, 6))
    plt.title('... vs ...') 
    plt.xlabel(data.feature_names[x]) # x diisi oleh salah satu index atribut
    plt.ylabel(data.feature_names[y]) # y diisi oleh salah satu index atribut
    for i in range(len(data.target_names)):
        bucket = df[df['Target'] == i]
        bucket = bucket.iloc[:,[x,y]].values # x dan y seperti yang diatas
        hull = myConvexHull(bucket)
        plt.scatter(hull.myPoints[:, 0], hull.myPoints[:, 1], label=data.target_names[i], color=colors[i])
        for simplex in hull.convexHullRelation:
            plt.plot(hull.myPoints[simplex, 0], hull.myPoints[simplex, 1], colors[i])
    plt.legend()
    
  2. Run Program

tucil02-stima's People

Contributors

ghebyon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.