-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel Processing Logic #27
base: master
Are you sure you want to change the base?
Conversation
Made changes to the Multiple Regression class for performance improvement. Introduced parallel processing for better performance when handling large datasets. Methods were also modified to include additional options for customization, such as matrix decomposition and data normalization. Code structure was enhanced for better readability and comprehensibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general comment but I wasn't able to find any changes for what you talked about with adding customization options for stuff like Matrix Decomposition, etc so I feel like I'm just being blind
var inputs0Length = inputs[0].Length; | ||
|
||
// Use parallel processing for large data sets | ||
Parallel.For(0, inputsLength, i => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need for Parallel processing for large datasets but this will actually create a performance bottleneck for small to average sized datasets so we should dynamically use Parallel.For when the inputs Length is a certain minimum size
// Initialize predictions array and store lengths for optimization | ||
var predictions = new double[inputs[0].Length]; | ||
var inputsLength = inputs.Length; | ||
var inputs0Length = inputs[0].Length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a minor issue but you are referencing the same inputs[0].Length on line 121 and 123 so you should move up your variable and use that variable for line 121
namespace AiDotNet.Regression; | ||
using System; | ||
using System.Threading.Tasks; | ||
using MathNet.Numerics.LinearAlgebra; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is another minor issue but we moved all using statements to Helpers/UsingsHelper.cs so if you can please move the necessary using statements there.
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Main point is the example of parallel processing logic, which I mentioned on our call. Feel free to scavenge whatever your need from this PR and modify the formatting to whatever your preference is.