-
Notifications
You must be signed in to change notification settings - Fork 2
/
classifier.py
37 lines (27 loc) · 1.08 KB
/
classifier.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from .base import BaseClassifier
import numpy as np
class Classifier(BaseClassifier):
def train(self, predictors, classifications, **kwargs):
"""
Train the model based on a table of predictors and known classifications
for objects in a training set.
:param predictors:
An :class:`astropy.table.Table` of possible predictors, where the
number of rows is the number of objects in the training set.
:param classifications:
An array of classifications for all objects in the training set.
This array should have the same length as the number of predictor
rows.
"""
return None
def classify(self, predictors, **kwargs):
"""
Classify a single object, given some predictors.
:param predictors:
A row of predictors for a single object.
:returns:
A single-valued classification for this object.
"""
return np.zeros(len(predictors))