Skip to main content

Causal discovery with ML

Project description

rosnet

๐Ÿ‡ฐ๐Ÿ‡ท โ€˜rosnetโ€™ ์€ ML์„ ์ ์šฉํ•œ causal discovery ํŒจํ‚ค์ง€์ž…๋‹ˆ๋‹ค. ์ œ ๊ฐœ์ธ ์—ฐ๊ตฌ๋ฅผ ์œ„ํ•ด ๋งŒ๋“ค์—ˆ์ง€๋งŒ, ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๋„ ์ตœ๋Œ€ํ•œ ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฝ๋„๋ก ์„ค๊ณ„ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ์ฝ”๋“œ๋Š” ํ˜ผ์ž์„œ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ์ด์šฉ์ž์˜ ํŽธ์˜๋ฅผ ์œ„ํ•ด ๋‹ค๋ฅธ ํŒจํ‚ค์ง€์˜ API ์„ค๊ณ„๋ฅผ ๋”ฐ๋ผํ•˜๊ธด ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ”  โ€˜rosnetโ€™ is causal discovery package applied ML . I made it for my personal study. But, it is designed to be used as easy for others as possible. I created all the codes by myself. However, for the user's convenience, I followed the API design of other packages.

๋ชฉ์  / Purpose

๐Ÿ‡ฐ๐Ÿ‡ท ์ด ํŒจํ‚ค์ง€์˜ ๋ชฉ์ ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค :

  • ML ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ Causal discovery์— ์ ์šฉ
  • ํ…์„œ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ธฐ์กด ML ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์žฌ์„ค๊ณ„

๐Ÿ”  The purpose of this package is as follows :

  • Applying ML algorithm to Causal discovery
  • Re-engineering existing ML algorithm based on tensor

์„ค์น˜ / Installment

!pip install rosnet

๐Ÿ”” ์š”๊ตฌ ํŒจํ‚ค์ง€ / Required package

  • numpy

์‚ฌ์šฉ๋ฒ• / Manual

๐Ÿ‡ฐ๐Ÿ‡ท ์ด ํŒจํ‚ค์ง€์˜ API๋Š” scikit-learn, keras ์™€ ๊ฑฐ์˜ ๋น„์Šทํ•ฉ๋‹ˆ๋‹ค!

  • ์˜ค์ง fit ๊ณผ predict, ๋‘ ๊ฐœ์˜ ํ•จ์ˆ˜๋งŒ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

๐Ÿ”  API of this package is just like scikit-learn and keras!

  • You only need to use two functions: fit and predict.

์˜ˆ์‹œ / Example

# Multilayer Perceptron

# **Notice** : I made some ML algorithm as needed, but not all of them.
#          If you just want to use ML algorithm itself, 
#          it is recommened to use other ML packages like scikit-learn, tensorflow ...

from rosnet.neural_network import layers
import rosnet.neural_network as network

X_train = # Your code, numpy.narray expected 
y_train = # Your code, numpy.narray expected

def build_model():
  model = network.Sequential([
    layers.Dense(64, activation='relu', input_shape=(X_train.shape[1], )),
    layers.Dense(64, activation='relu'),
    layers.Dense(64, activation='relu'),
    layers.Dense(64, activation='relu'),
    layers.Dense(4)
  ])

  optimizer = network.optimizers.SGD(0.001)

  model.compile(loss='mse',
                optimizer=optimizer,
                metrics=['mae', 'mse'])
  return model

model = build_model()
model.fit(X_train, y_train, 
					epochs=100, 
					batch_size = 1000, 
					validation_split = 0.2, 
					verbose = 0)

๊ฐœ๋ฐœ ๊ธฐ๋ก / Development log

0.0.1 - 22.03.26

  • rosnet.neural_network
    • rosnet.neural_network.Sequential add
    • rosnet.neural_network.layers add
    • rosnet.neural_network.optimizers add

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rosnet-0.1.9.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

rosnet-0.1.9-py3-none-any.whl (15.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page