Re: [Rdkit-discuss] RDKit Cookbook

2017-01-18 Thread Chris Swain
Hi,

I just copied the first 4 rows of the warning, it is actually repeated many, 
many times.

The change Greg suggests fixes things, thanks.

Chris
> On 19 Jan 2017, at 03:32, Greg Landrum  wrote:
> 
> Peter is correct, those are just warnings. But they are irritating warnings.
> You should be able to get rid of them by changing the call to:
> fig, maxweight = SimilarityMaps.GetSimilarityMapForModel(m5, 
> SimilarityMaps.GetMorganFingerprint, lambda x: getProba((x,), 
> rf.predict_proba))
> This passes getProba() a tuple with the fingerprint in question.
> 
> -greg
> 
> 
> On Thu, Jan 19, 2017 at 12:12 AM, Peter S. Shenkin  > wrote:
> These are not errors. They are warnings, as stated in the messages. 
> 
> Do you have any evidence that the procedure is not working? If not, the 
> reason is unlikely to be these warnings.
> 
> What the message is saying is that in a future release of sklearn 
> (scikit-learn), the calling code will have to use the validation module 
> differently. 
> 
> I don't know this part of RDKit, but the purport is presumably that whoever 
> is maintaining the part of RDKit that calls the validation module (directly 
> or indirectly) will have to make the change described in the warning messages 
> before RDKit starts using version 0.19 of sklearn. A quick google search 
> indicates that version 0.19 hasn't been released yet, so the current calling 
> protocol should work for now. But we have been forewarned
> 
> -P.
> 
> On Wed, Jan 18, 2017 at 2:26 PM, Chris Swain  > wrote:
> Hi,
> 
> I’ve been trying a few o the examples in 
> http://www.rdkit.org/docs/Cookbook.html 
> 
> 
> and I’d like to use the Similarity Maps as shown below
> 
> from rdkit.Chem.Draw import SimilarityMaps
> 
> # helper function
> def getProba(fp, predictionFunction):
>   return predictionFunction(fp)[0][1]
> 
> m5 = Chem.MolFromSmiles('c1c1O')
> fig, maxweight = SimilarityMaps.GetSimilarityMapForModel(m5, 
> SimilarityMaps.GetMorganFingerprint, lambda x: getProba(x, rf.predict_proba))
> But I get this error.
> 
> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
> your data has a single feature or X.reshape(1, -1) if it contains a single 
> sample.
>   DeprecationWarning)
> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
> your data has a single feature or X.reshape(1, -1) if it contains a single 
> sample.
>   DeprecationWarning)
> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
> your data has a single feature or X.reshape(1, -1) if it contains a single 
> sample.
>   DeprecationWarning)
> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
> your data has a single feature or X.reshape(1, -1) if it contains a single 
> sample.
>   DeprecationWarning)
> 
> Cheers,
> 
> Chris
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot 
> 
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net 
> 
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss 
> 
> 
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot 
> 
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net 
> 
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss 
> 
> 
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list

Re: [Rdkit-discuss] RDKit Cookbook

2017-01-18 Thread Greg Landrum
Peter is correct, those are just warnings. But they are irritating warnings.
You should be able to get rid of them by changing the call to:

fig, maxweight = SimilarityMaps.GetSimilarityMapForModel(m5,
SimilarityMaps.GetMorganFingerprint, lambda x: getProba((x,),
rf.predict_proba))

This passes getProba() a tuple with the fingerprint in question.

-greg


On Thu, Jan 19, 2017 at 12:12 AM, Peter S. Shenkin 
wrote:

> These are not errors. They are warnings, as stated in the messages.
>
> Do you have any evidence that the procedure is not working? If not, the
> reason is unlikely to be these warnings.
>
> What the message is saying is that in a future release of sklearn
> (scikit-learn), the calling code will have to use the validation module
> differently.
>
> I don't know this part of RDKit, but the purport is presumably that
> whoever is maintaining the part of RDKit that calls the validation module
> (directly or indirectly) will have to make the change described in the
> warning messages before RDKit starts using version 0.19 of sklearn. A quick
> google search indicates that version 0.19 hasn't been released yet, so the
> current calling protocol should work for now. But we have been
> forewarned
>
> -P.
>
> On Wed, Jan 18, 2017 at 2:26 PM, Chris Swain  wrote:
>
>> Hi,
>>
>> I’ve been trying a few o the examples in http://www.rdkit.org/docs/C
>> ookbook.html
>>
>> and I’d like to use the Similarity Maps as shown below
>>
>> from rdkit.Chem.Draw import SimilarityMaps
>> # helper functiondef getProba(fp, predictionFunction):
>>   return predictionFunction(fp)[0][1]
>> m5 = Chem.MolFromSmiles('c1c1O')fig, maxweight = 
>> SimilarityMaps.GetSimilarityMapForModel(m5, 
>> SimilarityMaps.GetMorganFingerprint, lambda x: getProba(x, rf.predict_proba))
>>
>> But I get this error.
>>
>> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
>> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
>> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
>> your data has a single feature or X.reshape(1, -1) if it contains a single 
>> sample.
>>   DeprecationWarning)
>> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
>> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
>> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
>> your data has a single feature or X.reshape(1, -1) if it contains a single 
>> sample.
>>   DeprecationWarning)
>> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
>> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
>> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
>> your data has a single feature or X.reshape(1, -1) if it contains a single 
>> sample.
>>   DeprecationWarning)
>> /usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
>> DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
>> raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
>> your data has a single feature or X.reshape(1, -1) if it contains a single 
>> sample.
>>   DeprecationWarning)
>>
>>
>> Cheers,
>>
>> Chris
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] RDKit Cookbook

2017-01-18 Thread Chris Swain
Hi,

I’ve been trying a few o the examples in 
http://www.rdkit.org/docs/Cookbook.html 


and I’d like to use the Similarity Maps as shown below

from rdkit.Chem.Draw import SimilarityMaps

# helper function
def getProba(fp, predictionFunction):
  return predictionFunction(fp)[0][1]

m5 = Chem.MolFromSmiles('c1c1O')
fig, maxweight = SimilarityMaps.GetSimilarityMapForModel(m5, 
SimilarityMaps.GetMorganFingerprint, lambda x: getProba(x, rf.predict_proba))
But I get this error.

/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
your data has a single feature or X.reshape(1, -1) if it contains a single 
sample.
  DeprecationWarning)
/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
your data has a single feature or X.reshape(1, -1) if it contains a single 
sample.
  DeprecationWarning)
/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
your data has a single feature or X.reshape(1, -1) if it contains a single 
sample.
  DeprecationWarning)
/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:395: 
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will 
raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if 
your data has a single feature or X.reshape(1, -1) if it contains a single 
sample.
  DeprecationWarning)

Cheers,

Chris--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss