Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

machine learning Advanced certification | Oct 17 - Nov 28 | Ramesh | 2020

Hi,
Was trying feature engineering -LDA with available data sets.
worked well for IRIS
But for DIGITS data set it is giving error as below while fitting with LDA. Logistic regression worked well with the original data and got results.
Attached the notebook as a zip file herewith.

While executing the below statement
digits_lda.fit(X,y)
Error at Line 122
LinAlgError: Singular matrix

Request guidance to resolve
 

Attachments

  • LDA on DIGITS Data set.zip
    10.1 KB · Views: 3
Hi,
Was trying feature engineering -LDA with available data sets.
worked well for IRIS
But for DIGITS data set it is giving error as below while fitting with LDA. Logistic regression worked well with the original data and got results.
Attached the notebook as a zip file herewith.

While executing the below statement
digits_lda.fit(X,y)
Error at Line 122
LinAlgError: Singular matrix

Request guidance to resolve
 
Hi,
Was trying feature engineering -LDA with available data sets.
worked well for IRIS
But for DIGITS data set it is giving error as below while fitting with LDA. Logistic regression worked well with the original data and got results.
Attached the notebook as a zip file herewith.

While executing the below statement
digits_lda.fit(X,y)
Error at Line 122
LinAlgError: Singular matrix

Request guidance to resolve
 
Good work and try JAIKISHAN.
Have not gone thru your solution in detail. Few clues which will help in debugging. lda fit you seem to pass complete original dataset. Check the attached ..
 

Attachments

  • ldadigits.zip
    1.4 KB · Views: 3
Good work and try JAIKISHAN.
Have not gone thru your solution in detail. Few clues which will help in debugging. lda fit you seem to pass complete original dataset. Check the attached ..
Hi,
I tried this earlier. I was getting 97 accuracy with out LDA. But when i tried to do LDA i used standardizer of the X .Then i got this error when i was fitting digits_lda.fit(X,y). This is where i got struck. Also i tried on one more data set John Cancer Hospital BREAST CANCER.There also i could build the standard model but with LDA got struck and could not proceed.
 
Hi,
I tried this earlier. I was getting 97 accuracy with out LDA. But when i tried to do LDA i used standardizer of the X .Then i got this error when i was fitting digits_lda.fit(X,y). This is where i got struck. Also i tried on one more data set John Cancer Hospital BREAST CANCER.There also i could build the standard model but with LDA got struck and could not proceed.
I tired LDA fitting on John Cancer Hospital BREAST CANCER with package imported from mlxtend.feature_extraction it gave error as SINGULAR . Then i tried LDA fitting with package imported from sklearn.discriminant_analysis. It worked well with accuracy of 96% on Logistic regression. Not sure why this is happening. Requesting your clarification.
 
I tired LDA fitting on John Cancer Hospital BREAST CANCER with package imported from mlxtend.feature_extraction it gave error as SINGULAR . Then i tried LDA fitting with package imported from sklearn.discriminant_analysis. It worked well with accuracy of 96% on Logistic regression. Not sure why this is happening. Requesting your clarification.
This was same case with another data set i tried (Olivetti faces data )
 

Omar Amr Mahmoud

Active Member
What is wrong with the code? I used the digitis dataset applied logistic regression, then pca and logistic regression. but in the lda it brings out the error. what is my mistake? and how do I continue to apply lda then logistic regression?
 

Attachments

  • 1.JPG
    1.JPG
    145.2 KB · Views: 5
  • 2.JPG
    2.JPG
    104.2 KB · Views: 5
What is wrong with the code? I used the digitis dataset applied logistic regression, then pca and logistic regression. but in the lda it brings out the error. what is my mistake? and how do I continue to apply lda then logistic regression?
Hi Omar,
I also encountered same problem but when i imported lda library from sklearn it worked. Enclosing the notebook for your reference if required.Not sure why it is happening
 

Attachments

  • LDA on DIGITS Data set-REWORKED.zip
    1.1 KB · Views: 3
Hi Ramesh,
Problem -Multivariate Linear regression.
I am trying to use column transformer with onehot encoder for a data set with 8 nominal categorical columns and balance more than 350 columns which are binary only(used Remained='passthrough'). After fitting the linear regression and when i tried to use the predict function, the X_test_transformed with the column transformer (same used for fit_transform X_train) the shapes (no of columns) have changed between X_train_transformed and X_test_transformed. Struck at this point and unable to move forward . Kindly advise .....

Again i tried to use Column transformer prior to split and able to implement linear regression.But got negative r2 score in standard linear reg .Improve slightly with regularisation,but not much.
r2 of test scores.
Linear -1.3 exp-23
Ridge 0.43
Lasso 0.47
Elasticnet 0.38

Can we do feature engineering with completely fully categorical variables to improve???
Request your suggestions....
 
Last edited:
Hi Ramesh,

Had made an attempt on the Timeseries of the Zinc metal price forecast. But the out come is not coming correctly(the value from the end of given data is not following the pattern). Please peruse and let me know where iam going wrong. Had cleared the output in the file to save size.
 

Attachments

  • Timeseries in ZINC Metal price data set-FACULTY REVIEW.zip
    2.3 KB · Views: 0

Omar Amr Mahmoud

Active Member
When fitting the ARIMA model and plotting the trained and predicted values and comparing the peaks of each. do we want the peaks of the model to be the same or close to the peaks of the data? or not ?
 
Came across this sheet from SCIKIT Learn which paves a way as navigation tree for selecting the models. Hope this shall be of use for beginners like us.
 

Attachments

  • Machine learning map form SCIKIT Learn.png
    Machine learning map form SCIKIT Learn.png
    743.2 KB · Views: 7

_79001

New Member
Dear Ramesh,

how to install XGBoost in jupyter notebook
it is giving error. - module not found.



in one of the project, it is needed for predicting.
 
Dear Ramesh,

how to install XGBoost in jupyter notebook
it is giving error. - module not found.



in one of the project, it is needed for predicting.

Hi,
You can try with this....

from xgboost import XGBClassifier
from xgboost import XGBRegressor
from sklearn.ensemble import AdaBoostClassifier
 

_89359

Member
Hi ,
I am one of the candidate of this batch of Ramesh sir and submit my assignment on 30-11-2020 but still no response on my assignment work , due to that reason i am not complete my test and certification , Please suggest where i complain that type of issue. Please reply soon
 
Hi, I was part of this class and submitted my assessment on 21st November and still waiting for results.
Does anyone else also facing this issue?
I have even raised a complaint for the same but have not hear back on the service request as well.
 
Last edited:
Top