(Tiểu luận) tiểu luận giữa kỳ môn xác suất thống kê ứng dụng cho công nghệ thông tin

49 26 0
(Tiểu luận) tiểu luận giữa kỳ môn xác suất thống kê ứng dụng cho công nghệ thông tin

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người thực hiện: LÂM QUANG HUY Lớp : Khố THÀNH PHỐ HỒ CHÍ MINH, NĂM 2022 0 Tieu luan 21H50201 : K25 TỔNG LIÊN ĐỒN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người thực hiện: LÂM QUANG HUY Lớp : 21H50201 Khố : K25 THÀNH PHỐ HỒ CHÍ MINH, NĂM 2022 0 Tieu luan LỜI CẢM ƠN Em cảm ơn thầy Nguyễn Quốc Bình giảng dạy cho em kiến thức lập trình ứng dụng xác suất thống kê hướng dẫn em thực tiểu luận kỳ 0 Tieu luan CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG Tơi xin cam đoan cơng trình nghiên cứu riêng tơi hướng dẫn khoa học TS Nguyễn Văn A; Các nội dung nghiên cứu, kết đề tài trung thực chưa công bố hình thức trước Những số liệu bảng biểu phục vụ cho việc phân tích, nhận xét, đánh giá tác giả thu thập từ nguồn khác có ghi rõ phần tài liệu tham khảo Ngồi ra, luận văn cịn sử dụng số nhận xét, đánh số liệu tác giả khác, quan tổ chức khác có trích dẫn thích nguồn gốc Nếu phát có gian lận tơi xin hồn tồn chịu trách nhiệm nội dung luận văn Trường đại học Tơn Đức Thắng không liên quan đến vi phạm tác quyền, quyền tơi gây q trình thực (nếu có) TP Hồ Chí Minh, ngày 26 tháng 10 năm 2022 Tác giả (ký tên ghi rõ họ tên) Lâm Quang Huy 0 Tieu luan TÓM TẮT Bài tiểu luận phần tóm tắt kiến thức mà học sinh học khoảng thời gian kì Về việc áp dụng kiến thức mơn xác suất thống kê học phần lí thuyết kết hợp phương pháp lập trình Python học lớp thực hành để giải số tốn.Trong có cụ thể nội dung nhóm chức mơ đun statistics thư viện Python Học sinh thực phần: phần viết code thuật tốn cân Histogram để xử lí ảnh phần viết báo cáo (3 chương) Cuối phần tiểu luận nguồn tài liệu học sinh tham khảo để làm tiểu luận 0 Tieu luan MỤC LỤC LỜI CẢM ƠN CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG TÓM TẮT MỤC LỤC CHAPTER – OPENING .6 1.1 Statistics library in Python .6 1.1.1 Gererality about Statistics library in Python 1.1.2 Some functions relate to Statistisc library .6 1.1.2.1 Statistics.mean(data) 1.1.2.2 Statistics.fmean(data) .8 1.1.2.3 statistics.geometric_mean(data) 10 1.1.2.4 Statistics.harmonic_mean(data, weights=None) 11 1.1.2.5 statistics.median(data) 13 1.1.2.6 Statistics.median_low(data) 16 1.1.2.7 Statistics.median_high(data) 18 1.1.2.8 Statistics.median_grouped(data) 19 1.1.2.9 Statistics.mode(data) 22 1.1.2.10 statistics.multimode(data) 24 1.1.2.11 statistics.quantile(data) 25 1.1.2.12 Statistics.pstdev(data, mu=None) 26 1.1.2.13 Statistics pvariance(data, mu=None) 27 1.1.2.14 Statistics.stdev(data, xbar=None) 29 1.1.2.15 Statistics variance(data, mu=None) 31 1.1.2.16 Statistics convariance(x, y, /) 34 1.1.2.17 statistics.correlation(x, y, /) 35 1.1.2.18 statistics.correlation(x, y, /) 36 CHAPTER – HISTOGRAM EQUALIZATION ALGORITHM 38 2.1 Histogram equalization algorithm .38 2.2 Example about Histogram equalization algorithm 39 2.3 My comment, analysis, evaluation .41 CHAPTER 3- IMPLEMENTATION .42 3.1 Implementation 42 0 Tieu luan TÀI LIỆU THAM KHẢO .45 PHỤ LỤC 46 0 Tieu luan CHAPTER – OPENING 1.1 Statistics library in Python 1.1.1 Gererality about Statistics library in Python In the era of big data and artificial intelligence, data science and machine learning have become essential in many fields of science and technology A necessary aspect of working with data is the ability to describe, summarize, and represent data visually Python statistics libraries are comprehensive, popular, and widely used tools that will assist you in working with data This module provides functions for calculating mathematical statistics of numeric (Real-valued) data The module is not intended to be a competitor to third-party libraries such as NumPy, SciPy, or proprietary full-featured statistics packages aimed at professional statisticians such as Minitab, SAS and Matlab It is aimed at the level of graphing and scientific calculators Descriptive statistics is about describing and summarizing data It uses two main approaches: - The quantitative approach describes and summarizes data numerically - The visual approach illustrates data with charts, plots, histograms, and other graphs 1.1.2 Some functions relate to Statistisc library Averages and measures of central location: - statistics.mean(data) - statistics.fmean(data) -statistics.geometric_mean(data) 0 Tieu luan - statistics.harmonic_mean(data, weights=None) - statistics.median(data) - statistics.median_low(data) - statistics.median_high(data)¶ - statistics.median_grouped(data, interval=1) - statistics.mode(data) -statistics.multimode(data) Measures of spread: -statistics.pstdev(data, mu=None) -statistics.pvariance(data, mu=None) -statistics.stdev(data, xbar=None) -statistics.variance(data, xbar=None) Statistics for relations between two inputs: -statistics.covariance(x, y, /) -statistics.correlation(x, y, /) -statistics.linear_regression(x, y, /, *, proportional=False) 1.1.2.1 Statistics.mean(data) - mean() function can be used to calculate mean/average of a given list of numbers It returns mean of the data set passed as parameters -Arithmetic mean is the sum of data divided by the number of data-points It is a measure of the central location of data in a set of values which vary in range In Python, we usually this by dividing the sum of given numbers with the count of number present -Syntax : mean([data-set]) -Parameters : -[data-set] : List or tuple of a set of numbers -Returns : Sample arithmetic mean of the provided data-set 0 Tieu luan -Exceptions : TypeError when anything other than numeric values are passed as parameter -Example: 1.1.2.2 Statistics.fmean(data) -A function fmean() converts all the data into float data-type and then computes the arithmetic mean or average of data that is provided in the form of a sequence or an iterable The output of this function is always a float 0 Tieu luan 33 0 Tieu luan 34 1.1.2.16 Statistics convariance(x, y, /) - Return the sample covariance of two inputs x and y Covariance is a measure of the joint variability of two inputs - Both inputs must be of the same length (no less than two), otherwise StatisticsError is raised - It’s represented through the formula:  If COV(xi, xj) = then variables are uncorrelated  If COV(xi, xj) > then variables positively correlated  If COV(xi, xj) > < then variables negatively correlated - Parameters: + x : [array_like] A 1D or 2D variables variables are columns + y : [array_like] It has the same form as that of m -Returns: It returns ndarray covariance matrix -Example: 0 Tieu luan 35 1.1.2.17 statistics.correlation(x, y, /) -Return the Pearson’s correlation coefficient for two inputs Pearson’s correlation coefficient r takes values between -1 and +1 It measures the strength and direction of the linear relationship, where +1 means very strong, positive linear relationship, -1 very strong, negative linear relationship, and no linear relationship -Both inputs must be of the same length (no less than two), and need not to be constant, otherwise StatisticsError is raised - Parameters: The statistics.correlation() method takes the x and y parameters which represent the x and y values for which the correlation coefficient is to be determined - Return value: The statistics.correlation() method returns the Pearson’s correlation coefficient for two given inputs - Example: 0 Tieu luan 36 1.1.2.18 statistics.correlation(x, y, /) -Return the slope and intercept of simple linear regression parameters estimated using ordinary least squares Simple linear regression describes the relationship between an independent variable x and a dependent variable y in terms of this linear function: y = slope * x + intercept + noise -where slope and intercept are the regression parameters that are estimated, and noise represents the variability of the data that was not explained by the linear regression (it is equal to the difference between predicted and actual values of the dependent variable) - Both inputs must be of the same length (no less than two), and the independent variable x cannot be constant; otherwise a StatisticsError is raised - For example, we can use the release dates of the Monty Python films to predict the cumulative number of Monty Python films that would have been produced by 2019 assuming that they had kept the pace - If proportional is true, the independent variable x and the dependent variable y are assumed to be directly proportional The data is fit to a line passing through the origin Since the intercept will always be 0.0, the underlying linear function simplifies to: 0 Tieu luan 37 y = slope * x + noise -Example: 0 Tieu luan 38 CHAPTER – HISTOGRAM EQUALIZATION ALGORITHM 2.1 Histogram equalization algorithm - Histogram equalization is a basic image processing technique that adjusts the global contrast of an image by updating the image histogram’s pixel intensity distribution Doing so enables areas of low contrast to obtain higher contrast in the output image -In the field of image processing, a histogram used to statistics the number of times that light levels occur in an image Essentially, histogram equalization works by:  Computing a histogram of image pixel intensities  Evenly spreading out and distributing the most frequent pixel values (i.e., the ones with the largest counts in the histogram)  Giving a linear trend to the cumulative distribution function (CDF) -The result of applying histogram equalization is an image with higher global contrast -We can further improve histogram equalization by applying an algorithm called Contrast Limited Adaptive Histogram Equalization (CLAHE), resulting in higher quality output images -Other than photographers using histogram equalization to correct under/over-exposed images, the most widely used histogram equalization application can be found in the medical field 0 Tieu luan 39 -You’ll typically see histogram equalization applied to X-ray scans and CT scans to improve the radiograph’s contrast Doing so helps doctors and radiologists better interpret the scans and make an accurate diagnosis -By the end of this tutorial, you will be able to successfully apply both basic histogram equalization and adaptive histogram equalization to images with OpenCV - The algorithm will work most with Opencv library 2.2 Example about Histogram equalization algorithm -Applying histogram equalization starts by computing the histogram of pixel intensities in an input grayscale/single-channel image: -Notice how our histogram has numerous peaks, indicating there are a good number of pixels binned to those respective buckets With histogram equalization, our goal is to spread these pixels to buckets that don’t have as many pixels binned to them -Mathematically, what this means is that we’re attempting to apply a linear trend to our cumulative distribution function (CDF): 0 Tieu luan 40 The before and after histogram equalization application can be seen in Figure 3: -With adaptive histogram equalization, we divide an input image into an M x N grid We then apply equalization to each cell in the grid, resulting in a higher quality output image: 0 Tieu luan 41 -The downside is that adaptive histogram equalization is by definition more computationally complex (but given modern hardware, both implementations are still quite speedy) 2.3 My comment, analysis, evaluation -In this tutorial, you learned how to perform both basic histogram equalization and adaptive histogram equalization with OpenCV -Basic histogram equalization aims to improve the global contrast of an image by “spreading out” pixel intensities often used in the image 0 Tieu luan 42 CHAPTER 3- IMPLEMENTATION 3.1 Implementation Instruction for building and running my sourcecode:  Import the library and the image  Build the function of calculating Histogram  Build Histogram equilibrium function 0 Tieu luan 43 My code: 0 Tieu luan 44 Result: The orginal 0 Tieu luan 45 My equalize The binary image The chart show the histogram of binary image and the equalized image 0 Tieu luan 46 TÀI LIỆU THAM KHẢO Tiếng Việt https://docs.python.org/3/library/statistics.html Tiếng Anh https://www.geeksforgeeks.org 0 Tieu luan 47 PHỤ LỤC Phần bao gồm nội dung cần thiết nhằm minh họa hỗ trợ cho nội dung luận văn số liệu, biểu mẫu, tranh ảnh sử dụng câu trả lời cho bảng câu hỏi bảng câu hỏi mẫu phải đưa vào phần Phụ lục dạng nguyên dùng để điều tra, thăm dò ý kiến; khơng tóm tắt sửa đổi Các tính tốn mẫu trình bày tóm tắt biểu mẫu cần nêu Phụ lục luận văn Phụ lục khơng dày phần luận văn 0 Tieu luan ... VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ MÔN: XÁC SUẤT THỐNG KÊ ỨNG DỤNG CHO CÔNG NGHỆ THÔNG TIN TIỂU LUẬN GIỮA KỲ Người hướng dẫn: TS NGUYỄN QUỐC BÌNH Người... luan LỜI CẢM ƠN Em cảm ơn thầy Nguyễn Quốc Bình giảng dạy cho em kiến thức lập trình ứng dụng xác suất thống kê hướng dẫn em thực tiểu luận kỳ 0 Tieu luan CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI... Lâm Quang Huy 0 Tieu luan TĨM TẮT Bài tiểu luận phần tóm tắt kiến thức mà học sinh học khoảng thời gian kì Về việc áp dụng kiến thức môn xác suất thống kê học phần lí thuyết kết hợp phương pháp

Ngày đăng: 06/02/2023, 09:22

Tài liệu cùng người dùng

Tài liệu liên quan