Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

with:

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

Hello,

I haven’t seen this error myself. But, I haven’t used the Miedema featurizer.

It sounds like this change would be a good addition to the featurizer to make it more robust, but am not familiar enough with the Miedema model to know if this is sensible from a physics standpoint. If so, we should make the change.

Anyone have some insight on that?

Best,

Logan

## ···

**From:** camilofs

**Sent:** Monday, August 5, 2019 3:48 PM

**To:** matminer

**Subject:** Miedema featurizer raising ‘invalid value encountered in power’

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

with:

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

–

You received this message because you are subscribed to the Google Groups “matminer” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/d78b8ee0-becc-4ad0-bff9-445c583da631%40googlegroups.com.

Hi,

Thanks for reporting the issue! May I ask what are the compositions that you have encountered this issue? The current formulation of Miedema featurizer follows that proposed by in the original papers, and v_a in deltaH_elast is to calculate the corrected molar volume in alloys for each element and should be positive if the formulation works for the composition. If the corrected volume becomes negative, I think this may indicates the formulation does work well for this composition. I can add some warnings etc after checking the compositions that cause problems.

Thanks,

Qi

## ···

On Monday, August 5, 2019 at 1:48:15 PM UTC-7, camilofs wrote:

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

with:

Hello Qi,

I’m sorry for the late reply, I had to play with the code a little bit because I’m working with a huge dataset. I listed all the compositions that trigger the error. It seems they are mostly Yb-based compounds:

- Original alp_a: [nan 4.36310832], altered alp_a: [-1.60619238 4.36310832], elements: [‘Yb’, ‘Tc’], fracs: [0.75, 0.25]
- Original alp_a: [nan 4.32327719], altered alp_a: [-2.13770725 4.32327719], elements: [‘Yb’, ‘Os’], fracs: [0.75, 0.25]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.75]
- Original alp_a: [nan 4.24102894], altered alp_a: [-2.08920192 4.24102894], elements: [‘Yb’, ‘Ru’], fracs: [0.5, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.3333333333333333, 0.3333333333333333]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.3333333333333333, 0.3333333333333333]
- Original alp_a: [nan 4.37065672], altered alp_a: [-2.66282293 4.37065672], elements: [‘Yb’, ‘Ir’], fracs: [0.25, 0.25]
- Original alp_a: [nan 3.66632229], altered alp_a: [-0.92031095 3.66632229], elements: [‘Yb’, ‘Ni’], fracs: [0.25, 0.25]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.5, 0.5]
- Original alp_a: [nan 3.68299042], altered alp_a: [-0.10113928 3.68299042], elements: [‘Yb’, ‘Co’], fracs: [0.14285714285714285, 0.14285714285714285]
- Original alp_a: [nan 3.68299042], altered alp_a: [-0.10113928 3.68299042], elements: [‘Yb’, ‘Co’], fracs: [0.3333333333333333, 0.6666666666666666]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.3333333333333333, 0.3333333333333333]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.3333333333333333, 0.3333333333333333]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.5, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.3333333333333333, 0.6666666666666666]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.37065672], altered alp_a: [-2.66282293 4.37065672], elements: [‘Yb’, ‘Ir’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.37065672], altered alp_a: [-2.66282293 4.37065672], elements: [‘Yb’, ‘Ir’], fracs: [0.5, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 2.50593455], altered alp_a: [-4.61346698 2.50593455], elements: [‘Yb’, ‘C’], fracs: [0.6, 0.2]
- Original alp_a: [nan 4.32327719], altered alp_a: [-2.13770725 4.32327719], elements: [‘Yb’, ‘Os’], fracs: [0.75, 0.25]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.3333333333333333, 0.6666666666666666]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.33832666], altered alp_a: [-2.97688536 4.33832666], elements: [‘Eu’, ‘Pd’], fracs: [0.3333333333333333, 0.6666666666666666]
- Original alp_a: [nan 2.50593455], altered alp_a: [-4.61346698 2.50593455], elements: [‘Yb’, ‘C’], fracs: [0.6, 0.2]
- Original alp_a: [nan 4.23662427], altered alp_a: [-3.77665755 4.23662427], elements: [‘Eu’, ‘Ir’], fracs: [0.3333333333333333, 0.6666666666666666]
- Original alp_a: [nan 3.66632229], altered alp_a: [-0.92031095 3.66632229], elements: [‘Yb’, ‘Ni’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.5, 0.25]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.57200213], altered alp_a: [-2.88730238 4.57200213], elements: [‘Yb’, ‘Pt’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.27023854], altered alp_a: [-1.90905579 4.27023854], elements: [‘Yb’, ‘Rh’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.47059931], altered alp_a: [-1.86700317 4.47059931], elements: [‘Yb’, ‘Pd’], fracs: [0.25, 0.5]
- Original alp_a: [nan 4.41608814], altered alp_a: [-1.21687729 4.41608814], elements: [‘Yb’, ‘Re’], fracs: [0.75, 0.25]
- Original alp_a: [nan 4.24102894], altered alp_a: [-2.08920192 4.24102894], elements: [‘Yb’, ‘Ru’], fracs: [0.75, 0.25]

## ···

Em seg, 5 de ago de 2019 às 19:16, Qi Wang [email protected] escreveu:

Hi,

Thanks for reporting the issue! May I ask what are the compositions that you have encountered this issue? The current formulation of Miedema featurizer follows that proposed by in the original papers, and v_a in deltaH_elast is to calculate the corrected molar volume in alloys for each element and should be positive if the formulation works for the composition. If the corrected volume becomes negative, I think this may indicates the formulation does work well for this composition. I can add some warnings etc after checking the compositions that cause problems.

Thanks,

Qi

On Monday, August 5, 2019 at 1:48:15 PM UTC-7, camilofs wrote:

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

with:

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

–

You received this message because you are subscribed to the Google Groups “matminer” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/78d0d3f6-afd7-4a34-8992-ad70c8c14fc2%40googlegroups.com.

Hi Camilo,

Thanks for the detailed report! Yeah, most of these compositions contain Yb or Eu. After checking the model parameters in Miedema.csv, it seems the current V_molar, Electron_density and Electronegativity for Yb and Eu are not so reasonable, especially the Electron_density, which is too small if compared to adjacent elements. This is the major cause of the negative V_a.

I have re-surveyed the model parameters listed in several papers, including R.F. Zhang et al. Computer Physics Communications 209 (2016) 58–69 (i.e. the 2nd reference listed in the Miedema featurizer). It turns out there are actually a set of updated parameters for Yb and Eu (Table 2 in the above paper). The V_molar, Electron_density and Electronegativity for Yb are changed from 24.87, 0.78, 2.58 to 17.97, 1.86, 3.22, and those for Eu are changed from 28.95, 0.68, 2.5 to 19.97, 1.77, 3.2. I tried most of the compositions you have listed with the updated parameters and all the deltaH functions went smoothly including detaH_elast. I also inspected the model parameters of other elements and they are the same with that in matminer.

I will submit a PR to update the parameters. Thanks for reporting this issue! Please let me know if you find other issues with the updated parameters.

Best,

Qi

## ···

On Monday, August 5, 2019 at 1:48:15 PM UTC-7, camilofs wrote:

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

with:

Qi, thank you so much. It is running smoothly now.

Late in the day, I’ll post a few suggestions regarding the prechecks for the Miedema and Yang featurizers, but that’s another topic.

Best,

## ···

Em quinta-feira, 8 de agosto de 2019 09:04:49 UTC-3, Qi Wang escreveu:

Hi Camilo,

Thanks for the detailed report! Yeah, most of these compositions contain Yb or Eu. After checking the model parameters in Miedema.csv, it seems the current V_molar, Electron_density and Electronegativity for Yb and Eu are not so reasonable, especially the Electron_density, which is too small if compared to adjacent elements. This is the major cause of the negative V_a.

I have re-surveyed the model parameters listed in several papers, including R.F. Zhang et al. Computer Physics Communications 209 (2016) 58–69 (i.e. the 2nd reference listed in the Miedema featurizer). It turns out there are actually a set of updated parameters for Yb and Eu (Table 2 in the above paper). The V_molar, Electron_density and Electronegativity for Yb are changed from 24.87, 0.78, 2.58 to 17.97, 1.86, 3.22, and those for Eu are changed from 28.95, 0.68, 2.5 to 19.97, 1.77, 3.2. I tried most of the compositions you have listed with the updated parameters and all the deltaH functions went smoothly including detaH_elast. I also inspected the model parameters of other elements and they are the same with that in matminer.

I will submit a PR to update the parameters. Thanks for reporting this issue! Please let me know if you find other issues with the updated parameters.

Best,

Qi

On Monday, August 5, 2019 at 1:48:15 PM UTC-7, camilofs wrote:

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

with:

Hi Camilo,

Great to hear that. Thanks for reporting this issue and proposing suggestions for improving the featurizers!

Best,

Qi

camilofs [email protected]于2019年8月8日 周四07:19写道：

## ···

Qi, thank you so much. It is running smoothly now.

Late in the day, I’ll post a few suggestions regarding the prechecks for the Miedema and Yang featurizers, but that’s another topic.

Best,

Em quinta-feira, 8 de agosto de 2019 09:04:49 UTC-3, Qi Wang escreveu:

Hi Camilo,

Thanks for the detailed report! Yeah, most of these compositions contain Yb or Eu. After checking the model parameters in Miedema.csv, it seems the current V_molar, Electron_density and Electronegativity for Yb and Eu are not so reasonable, especially the Electron_density, which is too small if compared to adjacent elements. This is the major cause of the negative V_a.

I have re-surveyed the model parameters listed in several papers, including R.F. Zhang et al. Computer Physics Communications 209 (2016) 58–69 (i.e. the 2nd reference listed in the Miedema featurizer). It turns out there are actually a set of updated parameters for Yb and Eu (Table 2 in the above paper). The V_molar, Electron_density and Electronegativity for Yb are changed from 24.87, 0.78, 2.58 to 17.97, 1.86, 3.22, and those for Eu are changed from 28.95, 0.68, 2.5 to 19.97, 1.77, 3.2. I tried most of the compositions you have listed with the updated parameters and all the deltaH functions went smoothly including detaH_elast. I also inspected the model parameters of other elements and they are the same with that in matminer.

I will submit a PR to update the parameters. Thanks for reporting this issue! Please let me know if you find other issues with the updated parameters.

Best,

Qi

On Monday, August 5, 2019 at 1:48:15 PM UTC-7, camilofs wrote:

Hello everyone. Have you ever raised the exception ‘invalid value encountered in power’ while running the Miedema featurizer?

I noticed the variable v_a (in deltaH_elast(…)) can be negative for a few compositions (even passing the precheck), therefore, causing this warning to be raised while calculating alp_a (matminer/featurizers/composition.py, Ln 1223).

I found a way around it substituting the following lines:

alp_a = (np.multiply(1.5, np.power(v_a, 2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))’

with:

alp_a = (np.multiply(1.5, np.sign(v_a) * (np.abs(v_a)) ** (2 / 3)) /

reduce(lambda x, y: 1 / x + 1 / y, np.power(n_ws, 1 / 3)))

# isolating the absolute value of v_a from its signal to perform the operation

I’m not sure if this was raised before, but I thought it would be good to share with y’all,

Thanks,

–

You received this message because you are subscribed to the Google Groups “matminer” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/02f34c47-b8ea-4f01-98ab-e5126872aff6%40googlegroups.com.