Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Using inverse distances #3

Open
HaoZeke opened this issue Dec 2, 2023 · 1 comment
Open

DOC: Using inverse distances #3

HaoZeke opened this issue Dec 2, 2023 · 1 comment

Comments

@HaoZeke
Copy link

HaoZeke commented Dec 2, 2023

Hi @avishart.

I'm setting up the eon interface to the restructuring branch again, and I noticed that the default_model class:

def get_default_model(model='tp',prior='median',use_derivatives=True,use_fingerprint=False,parallel=False,**kwargs):
    """
    Get the default ML model from the simple given arguments.

    Parameters:
        model : str
            Either the tp that gives the Studen T process or gp that gives the Gaussian process.
        prior : str
            Specify what prior mean should be used.
        use_derivatives : bool
            Whether to use derivatives of the targets.
        use_fingerprint : bool
            Whether to use fingerprints for the features.
            This has to be the same as for the database!
        parallel : bool
            Whether to optimize the hyperparameters in parallel.

    Returns:
        model : Model
            The Machine Learning Model with kernel and prior that are optimized.
    """

Doesn't specify how to use the inverse distances. I was previously constructing the model by hand but that's rather error prone.

@avishart
Copy link
Owner

avishart commented Dec 4, 2023

Hi @HaoZeke,
The default_model function is for the Gaussian or Student T process construction itself.
You can use get_default_mlmodel and give the Inverse distance fingerprint as an argument.
Like this:

from catlearn.regression.gaussianprocess.fingerprint.invdistances import Inv_distances
from catlearn.regression.gaussianprocess.calculator.mlcalc import MLCalculator
fp=Inv_distances(mic=False,sorting=False)
mlmodel=get_default_mlmodel(fp=fp)
mlcalc=MLCalculator(mlmodel=mlmodel)

Best regards,
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants