notes's Issues
Bias–variance tradeoff
pre-concept
The bias is an error from erroneous assumptions in the learning algorithm. High bias can cause an algorithm to miss the relevant relations between features and target outputs (underfitting).
Bias is the difference between the average prediction of our model and the correct value which we are trying to predict. Model with high bias pays very little attention to the training data and oversimplifies the model. It always leads to high error on training and test data.
The variance is an error from sensitivity to small fluctuations in the training set. High variance can cause an algorithm to model the random noise in the training data, rather than the intended outputs (overfitting).
Variance is the variability of model prediction for a given data point or a value which tells us spread of our data. Model with high variance pays a lot of attention to training data and does not generalize on the data which it hasn’t seen before. As a result, such models perform very well on training data but has high error rates on test data.
Different between Least squares and ridge regression:
Least squares wants to minimize the sum of the squared residuals
RidgeR want to minimize the sum of the squared residuals + lambda * slope^2 (penalty, lambda≥0)
strength
when we have more dims than the size of data size, Ridge can better settle this question than other regression
Least Squares :
Ridge regression:
conclusion
opencv_python3
shi...上次写的没有保存,重新开始吧...
cv2.line(img,(0,0),(150,150),(255,255,255),15)
为图片上画一条线
普通计算机都是RGB,但opencv是BGR,因此上面三个对应的分别是BGR
对于计算机来说,数字越大,颜色越亮,所以255,255,255是白色
15 means width
矩形:
cv2.rectangle(img,(15,25),(200,150),(0,0,255),15)
圆形:
cv2.circle(img,(100,63), 55, (0,255,0), -1)
-1 for thickness. This means the object will actually be filled in
多边形:
pts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32)
# OpenCV documentation had this code, which reshapes the array to a 1 x 2. I did not
# find this necessary, but you may:
#pts = pts.reshape((-1,1,2))
cv2.polylines(img, [pts], True, (0,255,255), 3)
为啥需要[]呢???
字体:
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(img,'OpenCV Tuts!',(0,130), font, 1, (200,255,155), 2, cv2.LINE_AA)
basic operation
change the color of single pixel
px = img[55,55]
#Next, we could actually change a pixel:
img[55,55] = [255,255,255]
Then re-reference:
px = img[55,55]
ROI=region of image
img[100:150,100:150] = [255,255,255]
watch_face = img[37:111,107:194]
img[0:74,0:87] = watch_face
cv2.imshow('image',img)
Bagging and bagging in sk-learn
pre-concept
ensemble methods use multiple learning algorithms to obtain better predictive performance than could be obtained from any of the constituent learning algorithms alone
Bootstrap aggregating, also called bagging, is a machine learning ensemble meta-algorithm designed to improve the stability and accuracy of machine learning algorithms used in statistical classification and regression.
The idea of bagging is to reduce overfitting of one model(according to what I learned before: to adding bias and reducing variance)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.