Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- AS
- For loops
- line color
- machine learning
- line width
- matplotlib
- Text Analytics
- PROJECT
- train/test
- break
- iterates
- matplotlib.pyplot
- pie charts
- __init__
- polynomial regression
- continue
- start exercise
- PANDAS
- Text mining
- SQL
- Github
- error
- self parameter
- Default X points
- data distribution
- Python
- multiple lines
- Else
- variables
- MySQL
Archives
- Today
- Total
Data Science Explorer
Mean Median Mode 본문
반응형
ModeResult(mode=11, count=1)
In machine learning, there are three values.
Mean: the average value
Median: the mid point value
Mode: the most common value
- Mean
It is the average value, divide the sum by the number of the values
Example
(99+86+87+88+111+86+103+87+94+78+77+85+86) / 13 = 89.77
import numpy
speed =[99,86,87,88,111,86,103,87,94,78,77,85,86]
x = numpy.mean(speed)
print(x)
89.76923076923077
- Median
It is the value in the middle of all the values.
Example
import numpy as np
height = [163, 154, 170, 175, 185]
x = numpy.median (height)
print(x)
170.0
- Mode
It appears the most number of the times, the most common number.
Example
Use scipy to get mode.
from scipy import stats
weight = [23, 45, 11, 89]
x = stats.mode(weight)
print (x)
** Scipy is a computation library that uses Numpy library and used for optimization, stats, and signal processing. **
'Machine Learning' 카테고리의 다른 글
Machine Learning: Percentiles (0) | 2023.11.14 |
---|---|
Machine Learning : Standard Deviation (0) | 2023.11.13 |
Text Mining #4 Stemming and Lemmatization (0) | 2023.09.06 |
Text Mining #3 Removing Stop Word (0) | 2023.09.05 |
Text Mining #2 Text Normalization (0) | 2023.09.05 |