Extract Classification Function In Supervised Learning - machine-learning

Possibly I am asking a trivial question but the answer is so crucial to me.
I'm really new to machine learning.I have read about Supervised learning and I know basics of these kind of algorithms.The question is when I'm using an algorithm such as j48 on a dataset how can I find the specified Function to use later to classify unlabeled data.
Thank you in advance

"Function" you are refering to is a classifier itself. It is being learned during the training procedure. Consequently, in order to use your model to classify new data you have to dump it to disk/database. How? It depends completely on the language/implementation used. For python you would simply pickle an object. In Java you can serialize your trained object or use Weka to learn j48 decision tree and save it for later use:
https://weka.wikispaces.com/Saving+and+loading+models

Related

Is GPT-3 a model or a framework?

We all hear GPT-3 being called a large language model (LLM), but is it really more of a framework since you can use GPT-3 with your own dataset, to train your own version of a GPT-3 model?
My understanding is that a model is the result of training, and you can use one of many frameworks/libraries to train the model (ex: tensor flow). If GPT-3 was just a model, you wouldn't be able to train with your own data on it, right? So that makes GPT-3 a framework?
Can anyone help me to better understand the AI terminology for this?
The terminology used is model.
A model in LLM is defined as a mathematical representation of language which is used to make predictions based on probabilities. Basically GPT was trained by turning works (tokens) into mathematical representations. In most cases each work is represented by a 1500 feature array (known in machine learning as a vector).
In the case of GPT-3, the latest model 'davinici-003' uses probability to make predictions on the response it gives based on the training it was provided.
With GPT-3 you can fine-tune the model to perform actions it hasn't been trained on before. It is still referred to as a model even though you can fine-tune it.

How to extract and transfer learnt parameters in svm(scikit)?

I have trained SVM image classifier using sklearn. Assignment requirement is to make separate "prediction.py" function which takes an image and classifies it. Generally it's done by clf.predict() but how can I get values of learnt coefficients so that I may transfer them to predict.py function?
The Scikit learn documentation addresses this, see https://scikit-learn.org/stable/modules/model_persistence.html

Why do I need decision tree to predict my test data when I'm giving large training data to train computer?

I'm a student of BSCS, I'm learning classification. One question has totally confused me. If I had made or written my coding for decision tree then why I need Large training data to predict answers of my test data? How training data is helping me when I am checking my each test data line through some lines of codes?
Passing them through step by step, if at any step they are not matching my conditions I'm writing no in answer if they are passing all conditions successfully then I'm writing Yes in answer using my code. Now how training data is helping ? If it help computer to predict then why I need my decision tree or model to answer my data?
Training data is used to build the tree.
If you write the tree manually as if-then rules, you did not do decision tree learning. You can have non-learned decision trees if a human writes a set of nested if statements.

machine learning algorithm that says which train data cause current decision

I need a learning model that when we test it with a data sample it says which train data cause the answer .
Is there anything that do this?
(I already know KNN will do this)
thanks
look for generative models
"It asks the question: based on generation assumptions, which category is most likely to generate this signal?"
This is not a very well worded question:
Which train data cause the answer? I already know KNN will do this
KNN will tell you what the K nearest neighbors are, but it's not just those K training samples that cause the answer, it's also all the other training samples by being farther away.
The objective of machine learning is to generalize from the whole of the training dataset, so all samples in the training dataset (after outlier filtering, dataset reduction steps) cause the answer.
If your question is 'Which class of machine learning algorithms makes a decision by comparing a new instance to instances seen in the training data, and can list the training examples which most strongly informed the decision?', the answer is: Instance based learning https://en.wikipedia.org/wiki/Instance-based_learning
(e.g. KNN, kernel machines, RBF)

How do I update a trained model (weka.classifiers.functions.MultilayerPerceptron) with new training data in Weka?

I would like to load a model I trained before and then update this model with new training data. But I found this task hard to accomplish.
I have learnt from Weka Wiki that
Classifiers implementing the weka.classifiers.UpdateableClassifier interface can be trained incrementally.
However, the regression model I trained is using weka.classifiers.functions.MultilayerPerceptron classifier which does not implement UpdateableClassifier.
Then I checked the Weka API and it turns out that no regression classifier implements UpdateableClassifier.
How can I train a regression model in Weka, and then update the model later with new training data after loading the model?
I have some data mining experience in Weka as well as in scikit-learn and r and updateble regression models do not exist in weka and scikit-learn as far as I know. Some R libraries however do support updating regression models (take a look at this linear regression model for example: http://stat.ethz.ch/R-manual/R-devel/library/stats/html/update.html), so if you are free to switching data mining tool this might help you out.
If you need to stick to Weka than I'm afraid that you would probably need to implement such a model yourself, but since I'm not a complete Weka expert please check with the guys at weka list (http://weka.wikispaces.com/Weka+Mailing+List).
The SGD classifier implementation in Weka supports multiple loss functions. Among them are two loss functions that are meant for linear regression, viz. Epsilon insensitive, and Huber loss functions.
Therefore one can use a linear regression trained with SGD as long as either of these two loss functions are used to minimize training error.

Resources