Week 1 - Lab
Week 1 - Lab
1
[Laboratory Orientation Introduction to Python]
Orientation
Setting of “house” rules.
Lab Rules and Regulations
Safety Precaution
Course Module
Your professor expects your full attention for the entire class period. If you know that
you’ll need to leave before the class is over, try to sit as close to the door as possible
so as not to disrupt others. Similarly, if you arrive in class late, just slip in as quietly
as possible and take the first available seat you come to.
Do not sleep in class! Laying your head on the desk or sleeping in class is rude, and it
is distracting to others. Turn in assignments on time.
Being courteous in class does not mean that you have to agree with everything that is
being said. However, your point will be much more credible if conveyed without
rudeness, aggression, or hostility. If you strongly disagree with your professor, it is a
good idea to speak with him/her after class.
When you have a question or comment, please raise your hand first as a courtesy to
your classmates and the professor. Remember, your questions are NOT an imposition
– they are welcome. Chances are, if you have a question, someone else is thinking the
same thing but is too shy to ask it. So, ask questions! You’ll learn more, it makes the
class more interesting, and you are helping others learn as well.
If an emergency arises that requires an absence from a session, it is your
responsibility to get the notes and all other information that was covered in class from
a colleague you trust.
All equipment must be returned to their original location after being used. Workspace
must be kept clean and tidy at all times.
Abuse of the laboratory hardware, software, and/or systems will result in dismissal
from the laboratory and disciplinary action.
Laboratory users are strictly prohibited from taking anything out from the laboratory
without prior consent from the laboratory staff.
Laboratory users are not allowed to repair the laboratory equipment themselves.
Please report immediately to the laboratory staff if you discover any problem with
the equipment/software. Please adhere to standard equipment operating procedure
at all times and handle all equipment with care.
Students should follow the instructions on the lab manual whenever possible.
Students are also encouraged to be creative and come up their own ways to achieve
the experiment's goal. However, if there is any change to the experimental apparatus
or the way of conducting the experiment, for safety reason, students should get the
instructor's permission before you try something original.
All laboratory users are liable for any damage to equipment due to their own
negligence.
Safety Precaution
Work with a dry hand.
Do not open up equipment casing.
Do not unplug any electrical connection.
Please refer to the lab sheet for other safety precautions in each individual
experiment.
Introduction to python
Introduction to Python Programming language
Python is developed by Guido van Rossum. Guido van Rossum started implementing
Python in 1989. Python is a very simple programming language so even if you are new to
programming, you can learn python without facing any issues.
Interesting fact: Python is named after the comedy television show Monty Python’s Flying
Circus. It is not named after the Python snake.
Course Module
Features of Python programming language
2. Easy to Learn: Learning python is easy as this is a expressive and high level programming
language, which means it is easy to understand the language and thus easy to learn.
3. Cross platform: Python is available and can run on various operating systems such as
Mac, Windows, Linux, Unix etc. This makes it a cross platform and portable language.
5. Large standard library: Python comes with a large standard library that has some handy
codes and functions which we can use while writing code in Python.
6. Free: Python is free to download and use. This means you can download it for free and use
it in your application. See: Open Source Python License. Python is an example of a FLOSS
(Free/Libre Open Source Software), which means you can freely distribute copies of this
software, read its source code and modify it.
7. Supports exception handling: If you are new, you may wonder what is an exception? An
exception is an event that can occur during program exception and can disrupt the normal
flow of program. Python supports exception handling which means we can write less error
prone code and can test various scenarios that can cause an exception later on.
8. Advanced features: Supports generators and list comprehensions. We will cover these
features later.
Python installation is pretty simple, you can install it on any operating system such as
Windows, Mac OS X, Ubuntu etc.
You can install Python on any operating system such as Windows, Mac OS X, Linux/Unix and
others.
This is the official Python website and it will detect the operating system and based on that
it would recommend you to download Python. Here I am using Mac OS X so it gave me the
download options for Python 2 and Python 3 for Mac OS X. I would recommend you to
download the latest version of Python 3 (Python 3.6.4 in the screenshot).
Installation steps are pretty simple. You just have to accept the agreement and finish the
installation.
If you are using Mac OS X then you may notice that Python is already installed in your system,
however it would most likely be a Python 2 so you can download the latest Python 3 version
from here and install it in your system.
Course Module
How to Get Started on Kaggle
Next, we'll give you a step-by-step action plan for gently ramping up and competing
on Kaggle.
First, we recommend picking one programming language and sticking with it. Both Python
and R are popular on Kaggle and in the broader data science community.
If you're starting with a blank slate, we recommend Python because it's a general-purpose
programming language that you can use from end-to-end.
The ability to load, navigate, and plot your data (i.e. exploratory analysis) is the first step in
data science because it informs the various decisions you'll make throughout model training.
If you go the route of Python, then we recommend the Seaborn library, which was designed
specifically for this purpose. It has high-level functions for plotting many of the most
common and useful charts.
Python Seaborn Tutorial
Before jumping into Kaggle, we recommend training a model on an easier, more manageable
dataset. This will allow you to become familiar with machine learning libraries and the lay of
the land.
The key is to start developing good habits, such as splitting your dataset into separate
training and testing sets, cross-validating to avoid overfitting, and using proper performance
metrics.
Now we're ready to try Kaggle competitions, which fall into several categories. The most
common ones are:
Research - These are research-oriented and have little to no prize money. They also
have non-traditional submission processes.
Recruitment - These are sponsored by companies who want to hire data scientists.
These are still relatively uncommon.
Getting Started - These are structured like featured competitions, but they have no
prize pools. They feature easier datasets, plenty of tutorials, and rolling submission windows
so you can enter them at any time.
The 'Getting Started' competitions are great for beginners because they give you a low-stakes
environment to learn, and they are also supported by many community-created tutorials.
With that foundation laid, it's time to progress to 'Featured' competitions. In general, these
will require much more time and effort to rank well.
For that reason, we recommend picking your battles wisely. Enter competitions that will
expose you to techniques and technologies that align with your long-term goals.
While prize money is nice, the more valuable (and reliable) reward will be the skills you'll
develop for your career.
Finally, we'll cover our 7 favorite tips for making the most out of your time on Kaggle.
If you've ever played an addicting video game, you'll know the power of incremental goals.
That's how great games get you hooked. Each goal is big enough for a sense of
accomplishment, yet realistic enough to be within reach.
Course Module
Most Kaggle participants will never win a single competition, and that's completely fine. If
you set that as your very first milestone, you may feel discouraged and lose motivation after
a few tries.
This strategy will allow you to measure your progress and improvement along the way.
Kaggle has a cool feature in which participants can submit "kernels," which are short
scripts that explore a concept, showcase a technique, or even share a solution.
[Introduction to Fuzzy/Neural Systems]
9
[Laboratory Orientation Introduction to Python]
When you start a competition or when you hit a plateau, reviewing popular kernels can spark
more ideas.
After all, what's the worst thing that could happen? Maybe you get ignored... and that's all.
On the other hand, you have plenty to gain, including advice and coaching from more
experienced data scientists.
In the beginning, we recommend working alone. This will force you to tackle every step of
the applied machine learning process, including exploratory analysis, data cleaning, feature
engineering, and model training.
If you start teaming up too early, you could miss opportunities to develop those cornerstone
skills.
Course Module
Tip #5: Team up to push your boundaries.
With that said, teaming up in future competitions can be a great way to push your boundaries
and learn from others. Many past winners have been teams who joined forces to combine
their knowledge.
In addition, once you master the technical skills of machine learning, you can collaborate
with others who may have more domain knowledge than you do, further expanding your
opportunities.
Remember, you're not necessarily committing to be a long-term Kaggler. If you find out that
you dislike the format, then it's no big deal.
In fact, many people use Kaggle as a stepping stone before moving onto their own projects
or becoming full-time data scientists.
This is another reason to focus on learning as much as you can. For the long run, it's better
to target competitions that will give you relevant experience than to chase the biggest prize
pools.
Some beginners never start because they're worried about low ranks showing up in their
profile. Of course, competition anxiety is a real phenomenon, and it isn't limited to Kaggle.
However, low ranks are really not a big deal. No one else will judge you because they were
all beginners at one point.
Even so, if you're still really worried about low rankings in your profile, you could also create
a separate practice account for learning the ropes. Once you feel comfortable, you can start
using your "main account" to build your trophy case.
[Introduction to Fuzzy/Neural Systems]
11
[Laboratory Orientation Introduction to Python]
Conclusion
Finally, we shared our 7 favorite tips for enjoying your time on the platform:
Course Module
Step 3: Split the inputs from the dataset
inputs=a(:,1:6)’;
Step 6: use import button to add the inputs and targets to create the Artificial Neural
Network
Course Module
Step 7: use New button to create the Artificial Neural Network by specifying the
parameters for the ANN
[Introduction to Fuzzy/Neural Systems]
15
[Laboratory Orientation Introduction to Python]
Course Module
Step 9: Double click the network to see the ANN and train the network
Step 10: click train button and set the training info and training parameters (inputs and
Targets)
[Introduction to Fuzzy/Neural Systems]
17
[Laboratory Orientation Introduction to Python]
Course Module
Step 12: export the network_outputs
[Introduction to Fuzzy/Neural Systems]
19
[Laboratory Orientation Introduction to Python]
Step 12: open the network_outputs from workspace and compare with the actual outputs
to check the accuracy of the NN learining
Course Module
If the value is greater than 0.9 then it is 1
If the value is less than 0.1 then it is 0
<Exercise 1. Implement artificial neural network model using python and Matlab
programming environment.
1. Chaitanya Singh; How to Install Python. (n.d.). Retrieved 14 May 2020, from
https://beginnersbook.com/2018/01/python-installation/; 14-05-2020
Course Module