Welcome to the Simplilearn Community

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

Sign Up

MACHINE LEARNING ADVANCED CERTIFICATION | JAN 9 2021 | Wajahat

_79801

Member
Hi Wajahat,

Please find attached assignment file.

Thanks,
Karthick.
 

Attachments

  • PCA_and_LinearDiscriminantAnalysis_On_Iris_DataSet.zip
    44 KB · Views: 2
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 .

Please suggest some solution.
 

Leela madhavi

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'



[ ]:

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

Your needful reply is highly appreciated.

-Leela
 

_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:

_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

_87415

Member
Hello Sir,

Kindly find the attachment of aus beer example

Thanks,
Shail
 

Attachments

  • aus_beer.pdf
    173.9 KB · Views: 2

Leela madhavi

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

Leela madhavi

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.
Appreciate your quick and needful reply.

-Leela
 

Attachments

  • agglomerative clustering_shopping.pdf
    24.2 KB · Views: 1

_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
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

Leela madhavi

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.
Appreciate your quick and needful reply.

-Leela
 

Attachments

  • ClusteringEx_ShoppingData.pdf
    25.6 KB · Views: 2
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
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
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.
 
Top