### Welcome to the Simplilearn Community

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

# MACHINE LEARNING ADVANCED CERTIFICATION | JAN 9 2021 | Wajahat

Hi Wajahat,

Thanks,
Karthick.

#### Attachments

• PCA_and_LinearDiscriminantAnalysis_On_Iris_DataSet.zip
44 KB · Views: 2

#### Abhishek Chanda_2

##### Member
Hi Wajahat,

Please look into this. This was an home assignment. We had discussed this in the class in the starting ten minutes on 16th jan.

Lesson 2: Slide 62

Q: Who was the top earning employee across all the years?
If we find the highest salary of years starting from 2011 to 2014:

print(df_sal.groupby('Year').max()[['TotalPayBenefits']])

TotalPayBenefits
Year
2011 567595.43
2012 407274.78
2013 425815.28
2014 510732.68

We had discussed the solution like:
df_sal.groupby('Year').max()[['EmployeeName','TotalPayBenefits']]

EmployeeName TotalPayBenefits
Year
2011
ZURI JONES 567595.43
2012 Zuri Jones 407274.78
2013 Zuri Jones 425815.28
2014 Zuri Jones 510732.68

Zuri Jones is not associated to these TotalPayBenefits, if we see the csv file manually row wise data. It is NATHANIEL FORD for 2011, Gary Altenberg for 2012 and so on .

##### Active Member
Lesson-End Project

Hi Kapil,

Please let me know the procedure to submit Project. Need to know below points:

How to convert -
1. source code to .pdf file
2. Output Report to .pdf file
3. Plots to screenshots or .pdf

-Leela

##### Active Member
Hi Kapil,

Please let me know the procedure to submit Project. Need to know below points:

How to convert -
1. source code to .pdf file
2. Output Report to .pdf file
3. Plots to screenshots or .pdf

-Leela

##### Active Member
Hi Wajahat,

Kindly look into the below KeyError: - I'm getting when I run Statement -
labels = dataframe['class_type'] - in SimpliLearn Lab (Jupyter Notebook)

==================================================>>>>>>>>>
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2645 try:
-> 2646return self._engine.get_loc(key)
2647 except KeyError:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'class_type'

During handling of the above exception, another exception occurred:

KeyError Traceback (most recent call last)
<ipython-input-33-c2acffc16fa6> in <module>
1 #labels = df_shopping['class_type']
----> 2labels=df_shopping['class_type']

/usr/local/lib/python3.7/site-packages/pandas/core/frame.py in __getitem__(self, key)
2798 if self.columns.nlevels > 1:
2799 return self._getitem_multilevel(key)
-> 2800indexer = self.columns.get_loc(key)
2801 if is_integer(indexer):
2802 indexer = [indexer]

/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2646 return self._engine.get_loc(key)
2647 except KeyError:
-> 2648return self._engine.get_loc(self._maybe_cast_indexer(key))
2649 indexer = self.get_indexer([key], method=method, tolerance=tolerance)
2650 if indexer.ndim > 1 or indexer.size > 1:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'class_type'

[ ]:

==================================================>>>>>>>>>>>>>>>>>>>

-Leela

#### ashish bramhe

##### Member
Here is my submission for Lesson 4 dogs image.

#### Attachments

• Lesson 4 Image dogs - Jupyter Notebook.pdf
459.7 KB · Views: 13

#### _79119

##### Member
K-Means: Dog assignment
By Anand
Thank you

#### Attachments

• Dog.pdf
96.7 KB · Views: 8
Last edited:

#### _86766

##### Member
Hi, Pls find the attached lesson end assignment for Lesson 7 "unsupervised learning"

Regards,
Laxmisha B V

#### Attachments

• L7_Practice5_K-Means_Clustering_Dog_Pic.zip
312.4 KB · Views: 4

#### _85954

##### Member
Hey,

Please Find the Lesson End Assignment.

Thanks & Best Regards
Sidharth S

#### Attachments

• Clustering-Dogs (2).pdf
291.5 KB · Views: 0
Last edited:

#### Harshitha Ashwath

##### Member
Hi Wajahat,

PFA Less end project

Thanks,
Harshitha

#### Attachments

• Lesson End Project 7.pdf
260.3 KB · Views: 6

#### David Wilson

##### New Member
Sharing the dogs clustering assignment. Thanks!

#### Attachments

• dogs.pdf
558.4 KB · Views: 2

#### _87415

##### Member
Hello Sir,

Kindly find the attachment of lesson end dog example.

Thanks and Regards,
Shail Shah

#### Attachments

• dog_shail_sub.pdf
155.9 KB · Views: 0

Hi,

PFA.

Regards,
Karthick

#### Attachments

• Lesson_End_Project_K_Means_Cluster.zip
332.6 KB · Views: 3

#### Kanumuru Shree JHanwwee

##### Member
Lesson 7 End Project
-Kanumuru Shree Jhanwwee

#### Attachments

• Jhanwwee_lesson7endproject.zip
639.7 KB · Views: 5

#### _87415

##### Member
Hello Sir,

Kindly find the attachment of aus beer example

Thanks,
Shail

#### Attachments

• aus_beer.pdf
173.9 KB · Views: 2

#### Pooja Rathore_3

##### Member
Hi Wajahat,
Please refer enclosed attachment for Beer_Month_prod_in_Aus

#### Attachments

• L8_Beer_LeeHiok_20210131.pdf
300.3 KB · Views: 4

#### Harshitha Ashwath

##### Member
Hi Wajahat,

Please find the attachment for Beer_Month_prod(ACF PACF)

Thanks,
Harshitha

#### Attachments

• ACF PACF UNASSISTED.pdf
297.9 KB · Views: 1

##### Active Member
Hi Wajahat,

Please find attached is the cluster example code using zoo.csv data file - which was executed successfully.

#### Attachments

• agglomerative clustering.pdf
22.7 KB · Views: 0

##### Active Member
Hi Wajahat,

Please find attached is the code: "agglomerative clustering_shopping.pdf" using "shopping_data.csv" data file, where in I'm getting KeyError:-
@labels = df['class_type'] statement and the corresponding errors related to this error.

Kindly look into the code and Update me with necessary corrections to be done in the code.

-Leela

#### Attachments

• agglomerative clustering_shopping.pdf
24.2 KB · Views: 1

#### _89624

##### Active Member
Hi Wajahat,

Good day !

Pls find assignment on Time Series ( Beer_Production)

Rgds
aiy1.blr@gmail.com

#### Attachments

• Beer_production_practise.zip
195.8 KB · Views: 1

#### Abhishek Chanda_2

##### Member
Hi,

I have attached the beer production Australia assignment

Thanks,
Abhishek

#### Attachments

• Beer_Production_Aus.pdf
683.2 KB · Views: 0

#### _86766

##### Member
Hi, Pls find the assginments related to "Time Series Modelling".

Regards,
Laxmisha B V

#### Attachments

• L8_Practice3_ARIMA_Air_Passenger.zip
229.3 KB · Views: 1
• L8_Practice4_ARIMA_Beer_Production.zip
282 KB · Views: 2

#### _85954

##### Member
Hello Wajahat,

Please Find the Assignment of TimeSeries .

Regards
Sidharth.

#### Attachments

• TimeSeries-AustrAnalysis.pdf
392.5 KB · Views: 0

#### _93280

##### New Member
hi wajat
PFA the time series zinc assignment
BR,
SARIKA

#### ashish bramhe

##### Member
Here are My assignments

#### Attachments

• BeerPrice - Jupyter Notebook.pdf
342.6 KB · Views: 0
• Zinc - Jupyter Notebook.pdf
393.2 KB · Views: 4

#### Abhishek Kumar_151

##### Member
Hi Wajahat,

Below are my assignments.

Thanks,
Abhishek Kumar

#### Attachments

• Beer production time series.pdf
592.7 KB · Views: 0
• Lesson End Time Series.pdf
527.2 KB · Views: 1

#### _85954

##### Member
Please Find the LessonEnd TimeSeries Assignment

Regards ,

Sidharth

#### Attachments

• TimeSeries LessonEnd Assignment.pdf
337.6 KB · Views: 1

#### _89624

##### Active Member
Hi Wajahat,

Good day

Pls find attached Lesson End- Time Series practice assesment file.

Regards
Aiysha

#### Attachments

• zinc_data_practice.zip
165.7 KB · Views: 1

#### _79223

##### Member
Hello Wajahat,

Please find the lesson end project of Ensemble Learning. (Car Evaluation)

Regards,
Ashwini

#### Attachments

• Ensemble_Car Evaluation.pdf
42 KB · Views: 7

#### _86766

##### Member
Hi, Pls find the attached assignment for Lesson 9 "Ensemble learning"

Regards,
Laxmisha B V

#### Attachments

• L9_Practice3_Cross_Validation_mtcars.zip
46.9 KB · Views: 3

##### Active Member
Hi Wajahat,

Please find attached is the code: "agglomerative clustering_shopping.pdf" using "shopping_data.csv" data file, where in I'm getting KeyError:-
@labels = df['class_type'] statement and the corresponding errors related to this error.

Kindly look into the code and Update me with necessary corrections to be done in the code.

-Leela

#### Attachments

• ClusteringEx_ShoppingData.pdf
25.6 KB · Views: 2

#### Abhishek Chanda_2

##### Member
Hi Wajahat,

I am facing issues with label encoder for the test set. Please take a look at it and suggest some solution. I am posting the PDF file here for the error, i am getting. It contains skeletal code and the code for label encoder.

Also, i am getting low pca.explained_variance_ratio_ for taking 2 components.

And, i did not see 'y' in the test set. So actual target values in test set are not available. We need to predict the target values.

Thanks,
Abhishek

#### Attachments

• Error in Label encoding -test data - Jupyter Notebook.pdf
81.6 KB · Views: 4

#### Tejaswini Kulkarni

##### New Member
Hi Wajahat,
I am taking this course offline by following your recorded sessions of (Jan 2021 batch).
I request you to review my assignments.
Here are the first 3 assignments of Data Exploration topic under Data Preprocessing.
Thank you.

#### Attachments

• DataExploration_AssistedPractice_1.pdf
27.5 KB · Views: 0
• DataExploration_AssistedPractice_2.pdf
39.8 KB · Views: 0
• DataExploration_AssistedPractice_3.pdf
40.8 KB · Views: 0

#### quincy batten

##### Member
KeyError: 'class_type'

A KeyError means the key you gave pandas isn’t valid. Before doing anything with the data frame, use print(df.columns) to see what keys are available.

print(df.columns)

I was getting a similar kind of error in one of my codes. Turns out, that particular index was missing from my data frame as I had dropped the empty dataframe rows. If this is the case, you can do df.reset_index(inplace=True) and the error should be resolved.