Code Monkey home page Code Monkey logo

iblm's Introduction

IBLM:Inductive-bias Learning Models

What is IBL?

IBL (Inductive-bias Learning) is a new machine learning modeling method that uses LLM to infer the structure of the model itself from the data set and outputs it as Python code. The learned model (code model) can be used as a machine learning model to predict a new dataset.In this repository, you can try different learning methods with IBL.(Currently only binary classification with simple methods is available.)

ibl

  • Currently, only binary classification is supported.

Examples

Use the link below to try it out immediately on Google colab.

  • Binary classification
    • IBL

      • OpenAI:Open In Colab
      • Claude:Open In Colab
    • IBLbagging

      • OpenAI:Open In Colab
      • Claude:Open In Colab

How to Use

  • Installation and Import
pip install iblm

import iblm
  • Setting

    • OpenAI

      os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY"
      
      ibl = iblm.IBLModel(api_type="openai", model_name="gpt-4-0125-preview", objective="binary")
    • Azure OpenAI

      os.environ["AZURE_OPENAI_KEY"] = "YOUR_API_KEY"
      os.environ["AZURE_OPENAI_ENDPOINT"] = "xxx"
      os.environ["OPENAI_API_VERSION"] = "xxx"
      
      ibl = iblm.IBLModel(api_type="azure", model_name="gpt-4-0125-preview", objective="binary")
    • Google API

      os.environ["GOOGLE_API_KEY"] = "YOUR_API_KEY"
      ibl = iblm.IBLModel(api_type="gemini", model_name="gemini-pro", objective="binary")
    • Anthropic API

      os.environ["ANTHROPIC_API_KEY"] = "YOUR_API_KEY"
      ibl = iblm.IBLModel(api_type="", model_name="", objective="binary")
  • Model Learning
    Currently, only small amounts of data can be executed.

    code_model = ibl.fit(x_train, y_train)
    
    print(code_model)
  • Model Predictions

    y_proba = ibl.predict(x_test)

Inductive-bias Learning Models

  • Inductive-bias Learning
    Normal Inductive-bias Learning

    from iblm import IBLBaggingModel
    
    iblm = IBLModel(
        api_type="openai",
        model_name="gpt-4-0125-preview",
        objective="binary"
        )
  • Inductive-bias Learning bagging
    Sampling data from a given dataset, we create multiple models, and the average of these models is used as the predicted value.

    from iblm import IBLBaggingModel
    
    iblbagging = IBLBaggingModel(
        api_type="openai",
        model_name="gpt-4-0125-preview",
        objective="binary",
        num_model=20,  # Number of models to create
        max_sample = 2000,  # Maximum number of samples from the data set
        min_sample = 300,  # Minimum number of samples from the data set
        )

Supported LLMs

  • OpenAI
    • gpt-4-0125-preview
    • gpt-3.5-turbo-0125
  • Azure OpenAI
    • gpt-4-0125-preview
    • gpt-3.5-turbo-0125
  • Google
    • gemini-pro
  • Anthropic
    • claude-3-opus-20240229
    • claude-3-sonnet-20240229

Contributor

Cite

If you find this repo helpful, please cite the following papers:

@article{tanaka2023inductive,
  title={Inductive-bias Learning: Generating Code Models with Large Language Model},
  author={Tanaka, Toma and Emoto, Naofumi and Yumibayashi, Tsukasa},
  journal={arXiv preprint arXiv:2308.09890},
  year={2023}
}

iblm's People

Contributors

cn47 avatar fuyu-quant avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

iblm's Issues

ibl.pyの編集

ibl.pyのベースの機能を別のpythonスクリプトに移してibl.pyはiblmodelファイルに作成する

feature-bagging_model

Create multiple models in parallel and create a model whose final output is the sum of the output values.

feature-boosting_model

Create multiple models that predict the difference in output values, and finally create a model whose output is the sum of the output values of the models created.

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.