File:Core Idea PLS.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this preview: 800 × 390 pixels. Other resolutions: 320 × 156 pixels | 975 × 475 pixels.
Original file (975 × 475 pixels, file size: 51 KB, MIME type: image/png)
File information
Structured data
Captions
Summary
[edit]DescriptionCore Idea PLS.png |
English: Core Idea of Partial Least Squares. When increases, and increase. For a detailed discussion see https://www.youtube.com/watch?v=Px2otK2nZ1c&t=46s |
Date | |
Source | Own work |
Author | Biggerj1 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cross_decomposition import PLSRegression
# Generate random data for input and output spaces
input_space = (np.random.randn(100, 2) @ np.array([[20, 0], [0, 3.0]]))
output_space = np.random.randn(100, 2)
output_space[:,0]=input_space[:,0]
output_space=output_space @ np.array([[3, 3], [8, 20.0]])
# Perform PLS with 2 components
pls = PLSRegression(n_components=2)
pls.fit(input_space, output_space)
# Calculate the PLS direction vectors
input_pls = pls.x_weights_
output_pls = pls.y_weights_
# Create the scatterplots
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))
# Plot input space
ax1.scatter(input_space[:, 0], input_space[:, 1], c='blue', alpha=0.5)
v1=ax1.quiver(0, 0, *input_pls[:, 0], scale=3, color='red', width=0.01, headwidth=3, headlength=4 )
ax1.set_title('Input Space')
ax1.set_xlabel('$x_1$')
ax1.set_ylabel('$x_2$')
ax1.axis('equal')
ax1.set_xlim(ax1.get_xlim()[0] - 1, ax1.get_xlim()[1] + 1)
ax1.set_ylim(ax1.get_ylim()[0] - 1, ax1.get_ylim()[1] + 1)
# Plot output space
ax2.scatter(output_space[:, 0], output_space[:, 1], c='green', alpha=0.5)
ax2.quiver(0, 0, *output_pls[:, 0], scale=3, color='red', width=0.01, headwidth=5, headlength=4)
ax2.set_title('Output Space')
ax2.set_xlabel('$y_1$')
ax2.set_ylabel('$y_2$')
ax2.axis('equal')
ax2.set_xlim(ax2.get_xlim()[0] - 1, ax2.get_xlim()[1] + 1)
ax2.set_ylim(ax2.get_ylim()[0] - 1, ax2.get_ylim()[1] + 1)
plt.show()
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 12:28, 6 September 2023 | 975 × 475 (51 KB) | Biggerj1 (talk | contribs) | tight layout | |
12:21, 6 September 2023 | 874 × 487 (52 KB) | Biggerj1 (talk | contribs) | use PLS for generation of direction vectors | ||
07:38, 6 September 2023 | 874 × 487 (33 KB) | Biggerj1 (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on de.wikipedia.org
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Software used | |
---|---|
Horizontal resolution | 39.37 dpc |
Vertical resolution | 39.37 dpc |
Structured data
Items portrayed in this file
depicts
6 September 2023
image/png
6cb9f87363dabdeb24b333b3076e2570b94206ae
52,040 byte
475 pixel
975 pixel
Hidden categories: