Skip to main content

A package for making predictions for Dipole Amplitude using a pre-trained Random Forest model

Project description

Dipole Amplitude Predictor Module

Overview

The Dipole Amplitude Predictor is a module designed for predicting dipole amplitudes using a trained RandomForest model. The module is easy to install and use, providing a ready-to-use model for your applications.

Installation

To install the module via PyPI, simply use:

pip install DipoleAmplitudePredictor

Alternatively, you can refer to the code in the following GitHub repositories for more details:

Usage

Once installed, you can use the module as follows:

from DipoleAmplitudePredictor import RandomForestModel
import numpy as np

# Example input array (X_new) to predict dipole amplitudes
X_new = [6.80213521e-05, 7.60105631e-05, 8.49278899e-05, 9.48961447e-05, 1.06028156e-04, 1.18472109e-04, 1.32375933e-04, 1.47911787e-04, 1.65270689e-04, 1.84666744e-04, 2.06338769e-04, 2.30553961e-04, 2.57610535e-04, 2.87841893e-04, 3.21620436e-04, 3.59362142e-04, 4.01532030e-04, 4.48649085e-04, 5.01293915e-04, 5.60114007e-04, 6.25834181e-04, 6.99262232e-04, 7.81302824e-04, 8.72963753e-04, 9.75373848e-04, 1.08979043e-03, 1.21762157e-03, 1.36043585e-03, 1.51998909e-03, 1.69823794e-03, 1.89737105e-03, 2.11982869e-03, 2.36833796e-03, 2.64594136e-03, 2.95603541e-03, 3.30241181e-03, 3.68929871e-03, 4.12141876e-03, 4.60403227e-03, 5.14301691e-03, 5.74491243e-03, 6.41702695e-03, 7.16748365e-03, 8.00535812e-03, 8.94072927e-03, 9.98485026e-03, 1.11502092e-02, 1.24507328e-02, 1.39018663e-02, 1.55208053e-02, 1.73266076e-02, 1.93404444e-02, 2.15857595e-02, 2.40885269e-02, 2.68774740e-02, 2.99843248e-02, 3.34441065e-02, 3.72953477e-02, 4.15804846e-02, 4.63459745e-02, 5.16428064e-02, 5.75264818e-02, 6.40576123e-02, 7.13017086e-02, 7.93298126e-02, 8.82180267e-02, 9.80480664e-02, 1.08906458e-01, 1.20884816e-01, 1.34078623e-01, 1.48586950e-01, 1.64510703e-01, 1.81951410e-01, 2.01008806e-01, 2.21778229e-01, 2.44347425e-01, 2.68792050e-01, 2.95171693e-01, 3.23523061e-01, 3.53855443e-01, 3.86141501e-01, 4.20312850e-01, 4.56249093e-01, 4.93774961e-01, 5.32649387e-01, 5.72566639e-01, 6.13148821e-01, 6.53954286e-01, 6.94478267e-01, 7.34171849e-01, 7.72455242e-01, 8.08748270e-01, 8.42497531e-01, 8.73213445e-01, 9.00505412e-01, 9.24111984e-01, 9.43929546e-01, 9.60016623e-01, 9.72598746e-01, 9.82034747e-01, 9.88802034e-01]
c2_value = 2.5
x_bj_target = 1e-3
X_new.append(c2_value)
X_new.append(x_bj_target)
X_new = np.array(X_new).reshape(1, -1)
# Note: Ensure that X_new has a shape of (no. of samples, 103), where the first 101 features correspond to the R_grid. Append the C2 value and the x_bj value for the prediction.

# Initialize the model and make predictions
rf_model = RandomForestModel()
predictions = rf_model.predict(X_new)  
print(predictions)
print("R values: ", rf_model.Rgrid()) # R-Grid

Note: Ensure that X_new has a shape of (no. of samples, 103), where the first 101 features correspond to the R_grid. Append the C2 value and the x_bj value for the prediction.

Refer to the GitHub repositories for additional examples and details on the input format.

Contributing

Feel free to open issues or submit pull requests if you have improvements or feature requests. You can find detailed contributions guidelines in the GitHub repositories.

License

Check the GitHub repositories for licensing details.

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

dipoleamplitudepredictor-0.2.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DipoleAmplitudePredictor-0.2.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file dipoleamplitudepredictor-0.2.1.tar.gz.

File metadata

File hashes

Hashes for dipoleamplitudepredictor-0.2.1.tar.gz
Algorithm Hash digest
SHA256 96282ee9b2956d9c7c058789d86a764047961712a71507e2e09d2540148e5f02
MD5 cc2f5168dea0c4f849cfe8842c0deedf
BLAKE2b-256 c982b2d8b489969e6a84dd95816b0614af42fec94bd2663cb68b4abb6ed62c7d

See more details on using hashes here.

File details

Details for the file DipoleAmplitudePredictor-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for DipoleAmplitudePredictor-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e58a768578f46ea5c9b62fb2f1e60b8803936bb89062a19d3ebd42cf421aac00
MD5 2eb8294d031af415f545b8e724d398a3
BLAKE2b-256 f13a39321c7623fe224d3db1480ecbc80ba9ed8b7774e87dec25a472b6237dde

See more details on using hashes here.

Supported by

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