matgenix / pysisso Goto Github PK
View Code? Open in Web Editor NEWPython interface to the SISSO (Sure Independence Screening and Sparsifying Operator) method.
License: Other
Python interface to the SISSO (Sure Independence Screening and Sparsifying Operator) method.
License: Other
Hi,
Thanks for sharing. I am currently running SISSO for examplaes you shared, when I ran the cubic_function.py in the 01_regresion folder, it gave me the following message:
ValueError: SISSOJob requires the SISSO executable to be in the path.
Default executable name is "SISSO" and you provided "SISSO".
Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable.
When I execute SISSO.exe, he works correctly, but I can't use pysisso, it always reminds me that the SISSO executable is not in the path, so I would like to ask if this SISSO executable is a file or a folder, and if it is a folder, which files it should contain, I am looking forward to your reply!
I have run the Fortran program and got the SISSO .exe executable, and I still get an error after setting up the virtual environment: ValueError: SISSOJob requires the SISSO executable to be in the path.
Hope to get answered. Thank you!
Dear David,
When applying all operations in the operation set "(+)(-)(*)(/)(exp)(exp-)(^-1)(^2)(^3)(sqrt)(cbrt)(log)(|-|)(scd)(^6)", I end up having the following error listed below.
Output:
Job return code is -9. Terminating...
Traceback (most recent call last):
File "/home/PycharmProjects/Pysisso_test/Diabetes Regression Test.py", line 34, in
sisso_regressor.fit(diabetes_X_train, diabetes_y_train) #generated predicted graph
File "/home/anaconda3/envs/mse-ml/lib/python3.8/site-packages/pysisso/sklearn.py", line 271, in fit
c.run()
File "/home/anaconda3/envs/mse-ml/lib/python3.8/site-packages/custodian/custodian.py", line 372, in run
self._run_job(job_n, job)
File "/home/anaconda3/envs/mse-ml/lib/python3.8/site-packages/custodian/custodian.py", line 510, in _run_job
raise ReturnCodeError(s, True)
custodian.custodian.ReturnCodeError: Job return code is -9. Terminating...
Could I check if there would be a way to fix this other than limiting operations to "(+)(*)(^2)(^3)(^-1)(cos)(sin)"? Also what would be the cause of this error?
Below is my code for reference.
Thanks.
Code:
import matplotlib.pyplot as plt
import numpy as np
from pysisso.sklearn import SISSORegressor
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
from pysisso.outputs import SISSOOut
from joblib import dump, load
NPOINTS = 100 # Number of data points
SIGMA = 0.5 # Randomness in the data points
PLOT_FIGURES = False # whether to interactively plot the figures with matplotlib
SAVE_FIGURES = False # whether to save the matplotlib figures to a file
CLEAN_RUN_DIR = False # whether to remove the SISSO_dir after the fit
diabetes_X, diabetes_y = datasets.load_diabetes(return_X_y=True)
diabetes_X_train = diabetes_X[:-20]
diabetes_X_test = diabetes_X[-20:]
diabetes_y_train = diabetes_y[:-20]
diabetes_y_test = diabetes_y[-20:]
sisso_regressor = SISSORegressor(
rung=3,#rung of the feature space to be constructed i.e number of iterative applications of the mathematical operations in the construction of the complex features. i.e depth
opset="(+)(-)()(/)(exp)(exp-)(^-1)(^2)(^3)(sqrt)(cbrt)(log)(|-|)(scd)(^6)", #"(+)(-)()(exp)(exp-)(^-1)(^2)(^3)(sqrt)(^6)(sin)(cos)"
desc_dim=3,#number of descriptors used, i.e number of columns composed
clean_run_dir=CLEAN_RUN_DIR,
maxcomplexity=3 #max feature complexity (number of operators in a feature) i.e overall no. aft combining cols.
)
sisso_regressor.fit(diabetes_X_train, diabetes_y_train) #generated predicted graph
"""
filename = 'model.sav'
dump(sisso_regressor, filename)
"""
diabetes_y_pred = sisso_regressor.predict(diabetes_X_test)
sisso_out = SISSOOut.from_file(filepath="SISSO_dir/SISSO.out")
sisso_model = sisso_out.model
descriptors = [str(d) for d in sisso_model.descriptors]
#print(sisso_model.descriptors)
#print(descriptors)
coeff = [d for d in sisso_model.coefficients[0]] #note, .coeff is 2D so must have [0] first
#print(coeff)
for i in coeff:
t = coeff.index(i)
i = round(i)
if i>=0: i = "+" + str(i)
elif i<0: i = str(i)
coeff[t]=i
output = "Model:"
for i in range(len(descriptors)):
output += " " + coeff[i] + descriptors[i] + " "
print(output)
print("RMSE: " + str(sisso_model.rmse[0])) #Note, .rmse is 2D so must have [0]
print("Dimension: " + str(sisso_model.dimension))
Sir,I'd like to ask you a question about installation. When I ran the first example, I encountered the following error.
SISSOJob requires the SISSO executable to be in the path.
Default executable name is "SISSO" and you provided "SISSO".
Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable.
Is there a problem with my installation?
Hi Dr. Waroquiers,
I have a query regarding the OMP. It was stated that OMP was to be applied before applying SISSO in the documentation. However, it was also stated that OMP would be a special case of SISSO.
Could I check if this means OMP is already included in the .fit of the SISSORegressor class, and that we do not have to implement it first, followed by the regression? That is, having
sisso_regressor = SISSORegressor(...)
sisso_regressor.fit(...)
would be enough to run the SISSO algorithm?
Thanks.
P.s Regarding the sisso executable path email I sent last week, it executes fine now thanks.
I just run your example and get that:
ValueError: Should get exactly one match for "Descriptor dimension:".
Hi,
Thanks for sharing. I am currently running SISSO for examplaes you shared, when I ran the cubic_function.py in the 01_regresion folder, it gave me the following message:
Job return code is 174. Terminating...
Traceback (most recent call last):
File "cubic_function.py", line 71, in
sisso_regressor.fit(X, y)
File "/home/zihanyu/anaconda2/envs/py36/lib/python3.6/site-packages/pysisso/sklearn.py", line 271, in fit
c.run()
File "/home/zihanyu/anaconda2/envs/py36/lib/python3.6/site-packages/custodian/custodian.py", line 372, in run
self._run_job(job_n, job)
File "/home/zihanyu/anaconda2/envs/py36/lib/python3.6/site-packages/custodian/custodian.py", line 510, in _run_job
raise ReturnCodeError(s, True)
custodian.custodian.ReturnCodeError: Job return code is 174. Terminating...
I am not sure where I did wrong and I don't see any solution for that. May I get some help for that? Thanks!
Dear David,
thank you for providing use a Python version of the SISSO approach. I am trying to run your example for the regression and I got this error : ""SISSOJob requires the SISSO executable to be in the path. Default executable name is "SISSO" and you provided "SISSO". Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable. ""
I already got the executable namely "sisso.x" from the repository you mentioned. However, I misunderstand the next steps to complete the installation.. Should I use also other files from such repository ?
Can you orientate me ?
Best,
It seems pysisso is not available on mac os with apple silicon chip. Is there any way to modify the source code?
Hi there,
Could anyone please guide me towards resolving the issue.
Thanks
The project requires a very old sklearn:
scikit-learn = "^0.23.1"
is there any reason a more modern version couldn't be used? That requirement makes this basically incompatible with modern installations.
When I add SISSO 3.0 in my path, I can successfully run SISSO in terminal. But when I execute cubic_function.py, I get following error:
/home/liwentao/robot/pysisso/examples_usage/basic/01_regression Traceback (most recent call last): File "/home/liwentao/robot/pysisso/examples_usage/basic/01_regression/cubic_function.py", line 64, in <module> sisso_regressor.fit(X, y) File "/home/liwentao/robot/pysisso/pysisso/sklearn.py", line 273, in fit self.sisso_out = SISSOOut.from_file( # pylint: disable=W0201 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/liwentao/robot/pysisso/pysisso/outputs.py", line 562, in from_file params = SISSOParams.from_string(match[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/liwentao/robot/pysisso/pysisso/outputs.py", line 501, in from_string raise ValueError( ValueError: Should get exactly one match for "Descriptor dimension:".
Are there any solutions? Thanks!
At this stage, SISSO is only working in serial when wrapped through pysisso.
I downloaded SISSO Fortran code from https://github.com/rouyang2017/SISSO
and I compiled it on Windows 10. Then I got "SISSO.exe" executable.
Then I move "SISSO.exe" to my pysisso working directory and I renamed "SISSO.exe" to "SISSO", as shown in below figure.
When I run python code containing SISSORegressor(), I got error message as below:
ValueError: SISSOJob requires the SISSO executable to be in the path.
Default executable name is "SISSO" and you provided "SISSO".
Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable.
I don't understand why I encountered this error even though I prepared SISSO executable in my working directory.
Hi, I am trying to run the examples in cluster system.Whenever I try to run the code using 'mpirun -np 8 python cubic.py',the following error comes,
sisso_regressor.fit(X, y)
File "/export/home/kjeyakumar/anaconda3/lib/python3.8/site-packages/pysisso/sklearn.py", line 271, in fit
c.run()
File "/export/home/kjeyakumar/anaconda3/lib/python3.8/site-packages/custodian/custodian.py", line 372, in run
self._run_job(job_n, job)
File "/export/home/kjeyakumar/anaconda3/lib/python3.8/site-packages/custodian/custodian.py", line 510, in _run_job
raise ReturnCodeError(s, True)
custodian.custodian.ReturnCodeError: Job return code is 1. Terminating...
I met with the following error when trying to install pysisso with peotry
cd pysisso
poetry add pysisso
Using version ^0.3.1 for pysisso
Updating dependencies
Resolving dependencies... (0.0s)
AssertionError
at ~/miniconda3/lib/python3.7/site-packages/poetry/mixology/incompatibility.py:60 in __init__
56│ # intersection, they're mutually exclusive, making this incompatibility
57│ # irrelevant, since we already know that mutually exclusive version
58│ # ranges are incompatible. We should never derive an irrelevant
59│ # incompatibility.
→ 60│ assert by_ref[ref] is not None
61│ else:
62│ by_ref[ref] = term
63│
64│ new_terms = []
Hi,
I can't install pysisso in ubuntu using pip, I get the following error:
error_pysisso.txt
How can I fix that?
I run your example and get that:
ValueError: Should get exactly one excerpt for input parameters in the string.
May I get some help for that? Thanks!
I added the path in ~/.bashrc. Still the error.
ValueError: SISSOJob requires the SISSO executable to be in the path.
Default executable name is "SISSO" and you provided "SISSO".
Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable.
Hello,
I tried to executre pip install pysisso both with latest release and version 0.3.1. First, I was told to install Visual C++14 with the corresponding link, which I did. Afterwards, I still get the error in the attached file and do not know how to solve it. Cloning the code, going to root pysisso and executing poetry install also failed.
I am using Windows, and python version 3.9.12. Could you help me with this?
Thanks in advance!
Milena
error_pysisso.txt
Hi, I'm just beginning to use this package, and I can't seem to get the example working.
System: NVIDIA HPC SDK 20.11
CUDA 11.0 Ubuntu 20.04
Steps to reproduce:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
export PATH="$HOME/.poetry/bin:$PATH"
git clone [email protected]:Matgenix/pysisso.git
cd pysisso ** poetry install
poetry shell
python examples_usage/basic/01_regression/cubic_function.py
Stack trace:
Traceback (most recent call last):
File "examples_usage/basic/01_regression/cubic_function.py", line 59, in
sisso_regressor.fit(X, y)
File "/home/jovyan/pysisso/pysisso/sklearn.py", line 271, in fit
c.run()
File "/home/jovyan/.cache/pypoetry/virtualenvs/pysisso-zaPbc9Aa-py3.7/lib/python3.7/site-packages/custodian/custodian.py", line 372, in run
self._run_job(job_n, job)
File "/home/jovyan/.cache/pypoetry/virtualenvs/pysisso-zaPbc9Aa-py3.7/lib/python3.7/site-packages/custodian/custodian.py", line 450, in _run_job
p = job.run()
File "/home/jovyan/pysisso/pysisso/jobs.py", line 58, in run
self.SISSO_exe
ValueError: SISSOJob requires the SISSO executable to be in the path.
Default executable name is "SISSO" and you provided "SISSO".
Download the SISSO code at https://github.com/rouyang2017/SISSO and compile the executable or fix the name of your executable.
Any idea what could be going wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.