Machine learning provides computer algorithms that automatically discover patterns in data and make intelligent decisions from them.
1
vote
1answer
41 views
Streaming learning OCaml
I wrote a simple online logistic regression, calibrated using gradient descent to compare the speed of an OCaml implementation vs the same Python script, executed with Pypy. It turned out that the ...
3
votes
1answer
37 views
A simple fully connected ANN module
I've written a simple module that creates a fully connected neural network of any size. The arguments of the train function are list of tuples with a training example array first and an array ...
3
votes
1answer
20 views
Efficient implementation of aggregating test/train data
Here is a short python snippet to ingest train data:
...
2
votes
1answer
25 views
Multi or n-armed bandit reinforcement learning in R
I am learning about reinforcement learning and came across the first and simplest form of reinforcement learning system called multi-armed reinforcement learning (also called as n-armed bandit). I ...
3
votes
0answers
29 views
A simple version of LSTM: check code and inputs
I have just begun learning Tensorflow and have written a simple version bidirectional lstm for sentence classification for 3 classes with 6000 training sentences. I am not sure if the whole training ...
0
votes
0answers
53 views
Using pandas and sklearn for forecasting stock market return
I have been using R for stock analysis and machine learning purpose but read somewhere that python is lot faster than R. So I am trying to learn python for stock analysis and machine learning.
I am ...
3
votes
1answer
172 views
Clustering 16 million records in parallel
I have a dataset with 16 million rows and may increase upwards of 30 million. I am using the parLapply to run across three cores in R. But it's taking two days to ...
0
votes
0answers
6 views
Reducing the memory footprints of tokenization [closed]
I am running difficulty of tokenization as processing a huge amount of text data. There are more than 1,000,000 records to deal with. I fail to deal with all of them and had to cut the data to proceed....
5
votes
1answer
90 views
Apriori algorithm in Python 2
This takes in a dataset, the minimum support and the minimum confidence values as its options, and returns the association rules.
I'm looking for pointers towards better optimization, documentation ...
6
votes
1answer
119 views
Similarity research : K-Nearest Neighbour(KNN) using a linear regression to determine the weights
I have a set of houses with categorical and numerical data. Later I will have a new house and my goal will be to find the 20 closest houses.
The code is working fine, and the result are not so bad but ...
1
vote
1answer
58 views
Entity resolution with NLTK
I am trying to write a script of Python code, for entity extraction and resolution.
The excerpts of the algorithm:
It is trying to extract the entity as PoS Tag with Hidden Markov Model(HMM).
After ...
6
votes
1answer
91 views
Random forest and machine learning
I am quite new to using python for machine learning. I come from a background of programming in Fortran, so as you may imagine, python is quite a leap. I work in chemistry and have become involved in ...
7
votes
1answer
92 views
A CNN in Python WITHOUT frameworks
Here's some code that I've written for implementing a Convolutional Neural Network for recognising handwritten digits from the MNIST dataset over the last two days (after a lot of research into ...
1
vote
1answer
182 views
Pattern recognition and machine learning - Bernoulli mixture model
I have been reading the book Pattern Recognition and Machine Learning (Bishop) for a while, and recently I came across this figure, which was created using Bernoulli mixture model on the MNIST dataset:...
3
votes
1answer
75 views
Different neural network activation functions and gradient descent
I've implemented a bunch of activation functions for neural networks, and I just want have validation that they work correctly mathematically. I implemented sigmoid, tanh, relu, arctan, step function, ...
1
vote
0answers
35 views
Self organizing maps
I have already asked similar question here, but I figured this place might be better on getting some actual implementation feedback.
I tried to implement a simple SOM. You can see the training ...
5
votes
1answer
196 views
k-means clustering algorithm implementation
Here is my personal implementation of the clustering k-means algorithm.
...
4
votes
1answer
64 views
Classification tree in Swift
As an effort to teach myself Swift as well as to get familiar with machine learning algorithms, I've been trying to implement common algorithms, starting with a Random Forest. This is, for the moment ...
11
votes
1answer
265 views
Make a summary from a larger text-file
This code makes summaries from larger texts.
I have searched around for an algorithm and found the following:
Associate words with their grammatical counterparts. (e.g. "city"
and "cities")
...
2
votes
1answer
61 views
Nested loops - Random Forest, multiple parameters
I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short:
Firstly, I declare a data frame in which model parameters and some stats will be saved.
Secondly, ...
0
votes
1answer
121 views
csv loader and kNN algorithm in Java
I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64..
As it stands my code applies the kNN ...
1
vote
1answer
54 views
SKlearn automate data pre treatment
I want to make a simple wrapper for sklearn models. The idea is that the wrapper automatically takes care of factors (columns of type "object") replacing them with ...
2
votes
1answer
80 views
ImprSimple chat bot written in python
I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too.
So far, it's warning a user if it's using some bad words (which are parsed from ...
0
votes
0answers
38 views
Naive-Bayes classifier, to be packaged in a function
I need to create a Naive-Bayes classifier. I have eight labels (S) stored in tumors object, and 20531 attributes (A), I have stored the P(S,A) in objects of name <...
4
votes
2answers
207 views
Tic-Tac-Toe machine learning
I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
1
vote
0answers
101 views
Increase performance of Spark-job Collaborative Recommendation.
This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins.
Note: I think takeOrdered is the ...
1
vote
0answers
76 views
Predicting a win/loss given prior game stats
The project: create a model that can (somewhat) accurately predict a win/loss given prior game stats. Wanted a review of code in general, in particular my use of the ...
4
votes
0answers
141 views
RandomForest multi-class classification
Below is the code I have for a RandomForest multiclass-classification model. I am reading from a CSV file and doing various transformations as seen in the code. I ...
3
votes
0answers
96 views
Logistic regression with eigen
I am a new to Eigen, and I implemented a logistic regression model with it. It works but I don't know whether it is implemented in an efficient way.
...
0
votes
0answers
46 views
Perceptron with 2 output neurons and binary input
To the best of my knowledge I've implemented a functional version of the perceptron algorithm, but as my knowledge is not so developed as of yet I'm wondering if I've done it correctly or not.
What ...
2
votes
1answer
299 views
Cross validation of gradient boosting machines
I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods.
...
6
votes
1answer
419 views
Calculate conditional probabilities and perform naive Bayes classification on a given data set
I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is ...
3
votes
1answer
145 views
1
vote
1answer
119 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 ...
3
votes
1answer
5k views
ID3 Decision Tree in python
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)....
3
votes
2answers
46 views
Asynchronous model fitting that allows termination in Python
The problem
When you work with Python interactively (e.g. in an IPython shell or notebook) and run a computationally intensive operation like fitting a machine-learning model that is implemented in a ...
4
votes
1answer
84 views
Random Forest Code Optimization
I am new to Python. I have built a model with randomforest in python. But I think my code is not optimized. Please look into my code and suggest if I have deviated from best practices.
Overview about ...
2
votes
2answers
50 views
ML Retraining project
Tear me to shreds.
The class RandomForestRetrainer will be used to retrain a machine learning algorithm. It has functionality for taking in a directory containing malware or benignware files and ...
2
votes
1answer
51 views
Randomly learning a neuron to act as a signal counter
I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at ...
3
votes
1answer
67 views
Batch Gradient Descent running too slowly
Following Data Science from Scratch by Joel Grus, I wrote a simple batch gradient descent solver in Python 2.7. I know this isn't the most efficient way to solve this problem, but this code should be ...
11
votes
3answers
3k views
Simple chat bot
I made a chat bot, that, as you talk to it, it learns to respond. But the way it speaks is strange, so if you have any ideas on how to make its response any more human, then please say so.
Anyway, ...
6
votes
2answers
395 views
Simple Java Neural Network
I've written a toy neural network in Java. I ran it several million times with the same outputs with only the randomized weights changing from run to run. The average of all of the outputs is not 0.5, ...
64
votes
1answer
2k views
Siamese neural network
I have been studying the architecture of the Siamese neural network introduced by Yann LeCun and his colleagues in 1994 for the recognition of signatures ("Signature verification using a Siamese time ...
5
votes
1answer
72 views
Designing a circuit of gates in Clojure and doing forward and backpropagation
I am reading Hacker's guide to Neural Networks. Since I am also learning Clojure, I tried to implement them in Clojure.
I would like the feedback about what could be more idiomatic and better in the ...
2
votes
0answers
471 views
Discretization of continuous attributes for automatic classification [closed]
Background
In machine learning, it's common to encounter the problem of making a decision as to which discrete category an object belongs to based on a set of continuous attributes. For example, we ...
11
votes
1answer
529 views
Modified Taylor diagrams
There is a type of diagram summarizing how well predictions from numerical models fit expectations; one obvious use case is comparing machine-learning regression models. Modified Taylor diagrams are ...
3
votes
2answers
41 views
loopification of highly procedureal, though fully functional, multiclass perceptron
I've implemented the multiclass perceptron in the one vs. all style.
I just thought about it and tried to implement it in the most basic way. I think it's correct though my f_measure is a bit low. ...
3
votes
1answer
466 views
Perceptron algorithm
This is the Perceptron algorithm, I wrote this implementation with my friend. It gets the job done, but it's quite dirty, perhaps one of you stylish hackers might help me beautify this beast.
This ...
4
votes
1answer
78 views
Implementation of Logistic Regression
Is this kind of vectorized operations the most efficient way to do this in matlab? Any critics about my code? Am I doing something wrong (i tested several times, I think it works). Notice that I use J ...
5
votes
1answer
416 views
ANFIS network based on Sugeno model I
I've been learning Common Lisp lately and I've implemented ANFIS network based on Sugeno model I.
Network layout and details can be read in these slides by Adriano Oliveira Cruz.
I use sigmoid as the ...