Whats up peps! I am back with the second part of machine learning. In the previous article, you must have get set the dataset. In this article, Machine Learning tutorials from A to Z - part 2, i am going to teach you about importing libraries. from where actually our coding begins.
Open your Spyder IDLE and then make your directory of the machine learning folder as the main directory. There you have to create a new file name: data_preprocessing.py and open it.
To import libraries, initially you should have to download those libraries: they are sklearn, pandas. matplotlib. You can download those libraries, for this open python shell and type:
sklearn - pip install -U scikit-learn
matplotlib - python3 -mpip install matplotlib
pandas - pip install pandas
numpy - pip install numpy
Now you can open, data_preprocessing.py file and type:
This data_preprocessing.py file looks like!!
Open your Spyder IDLE and then make your directory of the machine learning folder as the main directory. There you have to create a new file name: data_preprocessing.py and open it.
To import libraries, initially you should have to download those libraries: they are sklearn, pandas. matplotlib. You can download those libraries, for this open python shell and type:
sklearn - pip install -U scikit-learn
matplotlib - python3 -mpip install matplotlib
pandas - pip install pandas
numpy - pip install numpy
Now you can open, data_preprocessing.py file and type:
import pandas as pd import numpy as np import matplotlib.pyplot as plt
This data_preprocessing.py file looks like!!
Explanation:
We import these numpy as np in order to make our task easy. Numpy is the library having mathematical tools, we can use this for any mathematical operations and np is its use shortcut. import matplotlib.pyplot as plt here matplotlib is the library which makes us able to plot data and pyplot is another sub library of matplotlib
import pandas as pd here pandas is the library that helps to import and manage data set and pd is its shortcut call. Most of time we use pandas to import data set. Later on we will import downloaded data set from this. Now move to part 3.
No comments:
Post a Comment