Data science/Python(19)
-
Decision Tree _ Bagging Classifier simple example
# Instantiate the base model clf_dt = DecisionTreeClassifier(max_depth=4) # Build and train the Bagging classifier clf_bag = BaggingClassifier( n_estimators=21, base_estimator=clf_dt, random_state=500) clf_bag.fit(X_train, y_train) # Predict the labels of the test set pred = clf_bag.predict(X_test) # Show the F1-score print('F1-Score: {:.3f}'.format(f1_score(y_test, pred))) # Build and train the..
2023.02.21 -
How to print python file
1. Convert to PDF file # to download the xelatex brew install basictex sudo tlmgr update --self sudo tlmgr install texliveonfly sudo tlmgr install adjustbox sudo tlmgr install tcolorbox sudo tlmgr install collectbox sudo tlmgr install ucs sudo tlmgr install environ sudo tlmgr install trimspaces sudo tlmgr install titling sudo tlmgr install enumitem sudo tlmgr install rsfs 2. Convert to HTML file..
2023.02.20 -
Python - np.empty vs. np.zeros
When creating a new array of a given shape and typing in a programming language like Python, the values in the array are usually initialized to some default value. The default value can depend on the data type and language, but in Python, for example, the default value for a new array of integers is 0, and a new array of floats is a small, positive value close to 0. However, in some cases, we ma..
2023.02.15 -
Python Semester 1.
1. History of Python : Appeared in 1991, Guido Van Rossum : interpreted, object-oriented, high-level programming language with dynamic semantics 2. Why Python? : Attractive for Agile software development : use as a scripting language, powerful, applicable for GUI, games and more : Open-source, simple and easy, shortcodes, No compilation step(fast edit-test-debug cycle, increased productivity) : ..
2023.01.15 -
[IBM] Data Analysis with Python - Model Development
Model Development - by trying to predict the price of a car using the dataset - Linear regression - Model Evaluation using visualization - Polynomial Regression and pipelines - R-squared and MSE for in-sample Evaluation - Prediction and Decision Making - Model/Estimator: Mathematical equation used to predict the value given one or more other values Linear Regression and Multiple Linear Regressio..
2021.05.17 -
[IBM]Data Analysis with Python - Exploratory Data Analysis(EDA)
Exploratory Data Analysis(EDA) - to summarise the miain character of the data - uncover the relationships between different variables - extract important variables for the problem - What are the characteristics that have the most impact ? Descriptive Statistics - before building models, it's important to explore the data first - Calculate some Descriptive statistics for the data - help to descri..
2021.05.15 -
[IBM] Data Analysis with Python - Pre-Processing Data in Python
Pre-Processing: Data cleaning, Wrangling - process of converting or mapping data from one raw form into another format to make it ready for further analysis Dealing with missing values in Python - check the actual data - drop the missing values (variable, data entry) - replace the missing values with an average or similar data points ( less accurate ) - replace it by frequency - replace it based..
2021.05.14 -
[IBM] Python Project for Data Science - Extracting Stock Data Using a Python Library
I have watched the first 2 videos from the previous course. So I skipped them and went for the project directly. Final Project: Analyzing Stock Performance and Building a Dashboard - extract financial data like historical share price, quarterly revenue reporting - web scraping on popular stocks - Visualize in a dashboard to identify the patterns or trends #install the yfinace and import yfinance..
2021.05.11 -
[IBM]Python for Data Science, AI & Development - Data Analysis
*Data Analysis: Data acquisition in various ways and obtain necessary insights from a dataset *Binary File Format: when the file is not readable. containing formatting information : To read this file, it must be run on the appropriate software or processor first. : images, jpegs, GIFs, MP3s, documents format like word or pdf etc. *Reading the Image file : Python has PILlibrary which provides the..
2021.05.11 -
[IBM]Python for Data Science, AI & Development - Data engineering
*Data Engineering Process: Extract, Transform, Load *Working with different file formats 1. Specify whether the file is a binary or ASCII file 2. How the information is organized (Comma-separated values, csv file format stores tabular data in plain text) 1) Reading CSV file : spreadsheet file format, each cell is organized in rows and columns : the type can be varied. : Each record may contain o..
2021.05.11