Intel® oneAPI Data Analytics Library
Learn from community members on how to build compute-intensive applications that run efficiently on Intel® architecture.
225 Discussions

Intel extension for Scikitlearn error with PCA algorithm

Mostafa-
Employee
1,377 Views

Hello,

 

Our customer was trying to work with PCA algorithm through Intel extension for Scikitlearn, in DevCloud.

 

The error message reported is:

SKLEARNEX DEBUG: sklearn.decomposition.PCA.fit: patching failed with cause - The shape of X does not satisfy oneDAL requirements: number of features / number of samples >= 2
SKLEARNEX INFO: sklearn.decomposition.PCA.fit: fallback to original Scikit-learn

0 Kudos
1 Solution
JaideepK_Intel
Moderator
1,317 Views

Hi,


Thank you for posting in Intel Communities.


We were able to reproduce your issue from our end.

This is a known limitation in the Intel extension for Scikit-learn:


When the number of samples exceeds the number of features (samples > 2*features), both Scikit-learn and the Intel extension for Scikit-learn are going to work, else it is going to throw an error like you mentioned above.


Example:

In your sample if u swap n_features with n_samples i.e if

n_features=1000

n_samples=7000

Then your sample is going to work.


Thanks,

Jaideep




View solution in original post

0 Kudos
4 Replies
JaideepK_Intel
Moderator
1,318 Views

Hi,


Thank you for posting in Intel Communities.


We were able to reproduce your issue from our end.

This is a known limitation in the Intel extension for Scikit-learn:


When the number of samples exceeds the number of features (samples > 2*features), both Scikit-learn and the Intel extension for Scikit-learn are going to work, else it is going to throw an error like you mentioned above.


Example:

In your sample if u swap n_features with n_samples i.e if

n_features=1000

n_samples=7000

Then your sample is going to work.


Thanks,

Jaideep




0 Kudos
Mostafa-
Employee
1,310 Views

thank you, I replied back to our customer, and waiting their response.

0 Kudos
JaideepK_Intel
Moderator
1,287 Views

Hi,


If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue. Thank you!


Thanks,

Jaideep



0 Kudos
JaideepK_Intel
Moderator
1,273 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks,

Jaideep


0 Kudos
Reply