All Questions
Tagged with numpy machine-learning
25
questions
1
vote
0
answers
47
views
Recurrent Neural Network loss is NAN
I am training a neural network to use approximately 600 features (4103rd to last column of a df) to predict approximately 4000 values (7th to 4102nd column of the same df). I have standardized the ...
2
votes
1
answer
183
views
Generating a matrix with each row having normalized weights
I just asked this question over Stack Over Flow on how to improve my code and reposting it here as someone on Stack Overflow recommended this platform.
I have written two python functions and they are ...
2
votes
0
answers
46
views
Optimize binary classification model
I've created binary classification model from scratch, just to understand intuition behind that.
However when I compare my implementation to model from tensorflow/pytorch with the same parameters and ...
1
vote
1
answer
252
views
Smart Tic Tac Toe, a reinforcement learning approach
I'm currently familiarizing myself with reinforcement learning (RL). For convenience, instead of manually entering coordinates in the terminal, I created a very simple UI for testing trained agents ...
2
votes
1
answer
87
views
Forecasting stock market data using Support Vector Regression
I coded this Support Vector Regression (SVR) myself following some equations in a journal (see here, or here (not in English)). The loss function used by the journal and the code below is mean ...
6
votes
1
answer
179
views
Multithreaded HD Image Processing + Logistic reg. Classifier + Visualization
[I'm awaiting suggestions for improvement/optimization/more speed/general feedback ...]
This code takes a label and a folder path of subfolders as input that have certain labels ex: trees, cats with ...
2
votes
1
answer
110
views
K_nearest_neighbors from scratch [closed]
I wanted to create a script that will perform the k_nearest_neighbors algorithm on the well-known iris dataset. This was mainly for me to better understand the algorithm and process. I think it works, ...
1
vote
0
answers
201
views
condensed nearest centroid classifier in numpy
This is my attempt to write a numpy-optimized version of a nearest centroid classifier to classify some images from the MNIST data set of handwritten digits. I am ...
2
votes
1
answer
2k
views
Simple Genetic Algorithm in Python
For past few months I was trying to understand genetic algorithms (GA) and most of the materials availble in the web was not always easy for me. Then I came across this article written by Ahmed Gad ...
4
votes
1
answer
109
views
Set of one-hot encoders in Python
In the absence of feature-complete and easy-to-use one-hot encoders in the Python ecosystem I've made a set of my own. This is intended to be a small library, so I want to make sure it's as clear and ...
5
votes
1
answer
6k
views
k-means using numpy
This is k-means implementation using Python (numpy). I believe there is room for improvement when it comes to computing distances (given I'm using a list comprehension, maybe I could also pack it in a ...
8
votes
2
answers
483
views
Univariate linear regression from scratch in Python
I am relatively new to machine learning and I believe one of the best ways for me to get the intuition behind most algorithms is to write them from scratch before using tons of external libraries.
...
4
votes
1
answer
290
views
Linear Regression on random data
Wrote a simple script to implement Linear regression and practice numpy/pandas. Uses random data, so obviously weights (thetas) have no significant meaning. Looking for feedback on
Performance
Python ...
3
votes
2
answers
115
views
Inefficient Regularized Logistic Regression with Numpy
I am a machine learning noob attempting to implement regularized logistic regression via Newton's method.
The example data have two features which are to be expanded to 28 through finding all ...
6
votes
3
answers
10k
views
Gradient descent for linear regression using numpy/pandas
I currently follow along Andrew Ng's Machine Learning Course on Coursera and wanted to implement the gradient descent algorithm in python3 using ...
2
votes
0
answers
892
views
Implementing Adagrad in Python
I'm trying to implement Adagrad in Python. For learning purposes, I am using matrix factorisation as an example. I'd be using Autograd for computing the gradients.
My main question is if the ...
3
votes
0
answers
1k
views
Implementing the stochastic gradient descent algorithm of the softmax regression with only NumPy [closed]
I am implementing the stochastic gradient descent algorithm. I think there is plenty of room for improvement.
...
2
votes
1
answer
3k
views
Multivariable Gradient Descent in Numpy
Just recently started learning ML, first I've gone through the notes of Ng's Coursera stuff. While I have nothing against Octave, I'm trying to solve exercises in Python. It's my beginning with that ...
25
votes
1
answer
1k
views
Backpropagation in simple Neural Network
I've been working on a simple neural network implemented in python. Currently, it seems to be learning, but unfortunately it doesn't seem to be learning effectively. The graph below shows the output ...
7
votes
1
answer
6k
views
k-means clustering algorithm implementation
Here is my personal implementation of the clustering k-means algorithm.
...
2
votes
1
answer
2k
views
Cross validation of gradient boosting machines
I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods.
...
3
votes
1
answer
1k
views
Latent Dirichlet Allocation in Python
I've recently finished writing a "simple-as-possible" LDA code in Python.
The theory from which I've developed my code can be found in the book Computer Vision by Simon Prince, free (courtesy of ...
2
votes
1
answer
24k
views
ID3 Decision Tree in python [closed]
I've been working my way through Pedro Domingos' machine learning course videos (although the course is not currently active). His first homework assignment starts with coding up a decision tree (ID3)....
8
votes
1
answer
334
views
Implementation of a new algorithm for sklearn
In the Python library, sklearn is implemented the algorithm for SparsePCA.
I have written the code for a another version of this algorithm that is much faster in some situations. I have not enough ...
5
votes
2
answers
698
views
Defensive programming type-checking
I have issues with dynamically typed languages, and I tend to worry about type a lot.
Numpy has different behaviour depending on if something is a matrix or a plain ndarray, or a list. I didn't ...