polymon.estimator
Available Estimators
Estimator Type |
Class Name |
Description |
|---|---|---|
|
Atom contribution estimator |
|
|
Density estimator |
|
|
Density estimator (IBM) |
|
|
Density estimator (Fedors) |
|
|
Low fidelity estimator |
|
|
Machine learning estimator |
|
|
Rg estimator (NetworkX) |
|
|
Rg estimator (DFS) |
Atom Contribution Estimator
- class polymon.estimator.atom_contrib.AtomContribEstimator(atom_contrib: ndarray)[source]
Bases:
BaseEstimatorAtom contribution estimator. It is used to estimate the label of a polymer based on the atom composition.
- Parameters:
atom_contrib (np.ndarray) – The atom contribution coefficients. It is a 1D array of shape (MAX_NUM_ELEMENTS,). The i-th element is the contribution of the i-th element to the label. The i-th element is the number of atoms of the i-th element in the polymer. The MAX_NUM_ELEMENTS is 100.
- estimated_y(smiles: str) float[source]
Estimate the label of a polymer based on the atom composition.
- Parameters:
smiles (str) – The SMILES of the polymer.
- Returns:
The estimated label of the polymer.
- Return type:
float
- classmethod from_fitting(df: DataFrame, smiles_col: str = 'SMILES', label_col: str = 'FFV') AtomContribEstimator[source]
Fit the atom contribution estimator from a dataframe.
- Parameters:
df (pd.DataFrame) – The dataframe containing the SMILES and label.
smiles_col (str) – The column name of the SMILES.
label_col (str) – The column name of the label.
- Returns:
The fitted atom contribution estimator.
- Return type:
- classmethod from_npy(path: str) AtomContribEstimator[source]
Load the atom contribution estimator from a npy file.
- Parameters:
path (str) – The path to the npy file.
- Returns:
The loaded atom contribution estimator.
- Return type:
Density Estimator (van der Waals)
Density Estimator (Fedors)
Density Estimator (IBM)
- class polymon.estimator.density_ibm.DensityIBMEstimator[source]
Bases:
BaseEstimatorDensity estimator using the IBM method. This is a group contribution method that assigns a contribution to each group of atoms in the molecule. The original implementation is from https://github.com/IBM/polymer_property_prediction.
Low Fidelity Estimator
- class polymon.estimator.low_fidelity.LowFidelityEstimator(model_info: Dict[str, Any])[source]
Bases:
BaseEstimatorLow fidelity estimator. This is a simple estimator that uses a model to estimate the label of a polymer. The model is a trained model on a low fidelity dataset. The model should be an object of
polymon.model.base.ModelWrapper.
Machine Learning Estimator
- class polymon.estimator.ml.MLEstimator(model, feature_names: List[str] = ['rdkit2d'])[source]
Bases:
BaseEstimatorMachine learning estimator. This is a simple estimator that uses a model to estimate the label of a polymer. The model is a trained model on a dataset. The model should be an object of sklearn model.
- estimated_y(smiles: str) float[source]
Estimate the label of a polymer based on the machine learning model.
- Parameters:
smiles (str) – The SMILES of the polymer.
- Returns:
The estimated label of the polymer.
- Return type:
float
Rg Estimator (NetworkX)
- class polymon.estimator.nx_rg.NxRgEstimator(N: int = 680, C_inf: float = 6.7, solvent: str = 'theta')[source]
Bases:
BaseEstimatorRadius of gyration estimator using NetworkX. This is a simple estimator that uses NetworkX to estimate the radius of gyration of a polymer.
- estimated_y(smiles: str) float[source]
Estimate the radius of gyration of a polymer based on the NetworkX method.
- Parameters:
smiles (str) – The SMILES of the polymer.
- Returns:
The estimated radius of gyration of the polymer.
- Return type:
float
Rg Estimator (DFS)
- class polymon.estimator.rg.RgEstimator(N: int = 600, C_inf: float = 6.7, solvent: str = 'theta')[source]
Bases:
BaseEstimatorRadius of gyration estimator using DFS. This is a simple estimator that uses DFS to estimate the radius of gyration of a polymer.
- estimated_y(smiles: str) float[source]
Estimate the radius of gyration of a polymer based on the DFS method.
- Parameters:
smiles (str) – The SMILES of the polymer.
- Returns:
The estimated radius of gyration of the polymer.
- Return type:
float