1.训练集规模:
数据(第一行为维度,每个字段的名字):
第二行为具体真是样本数据:第一列是标签,后面是特征(0-9的数字识别)
样本格式(10分类,每个类别的样本数较均匀):
图像:28*28:
softmax代码:
# encoding=utf8
import sys
import math
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
class Softmax(object):
def __init__(self):
self.learning_step = 0.000001 # 学习速率
self.max_iteration = 1000 # 最大迭代次数
self.weigh