diff --git a/cc b/cc new file mode 160000 index 0000000000000000000000000000000000000000..945ce4a51802fcae3b2eb1c26de961dfcc45588d --- /dev/null +++ b/cc @@ -0,0 +1 @@ +Subproject commit 945ce4a51802fcae3b2eb1c26de961dfcc45588d diff --git a/dai/server/__pycache__/server.cpython-312.pyc b/dai/server/__pycache__/server.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cedae73532079a22b932876070985acde24d4c92 Binary files /dev/null and b/dai/server/__pycache__/server.cpython-312.pyc differ diff --git a/dai/server/__pycache__/theta.cpython-312.pyc b/dai/server/__pycache__/theta.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a238808fe98ceb89a61204b0f324d8c11822355f Binary files /dev/null and b/dai/server/__pycache__/theta.cpython-312.pyc differ diff --git a/dai/server/linear.py b/dai/server/linear.py new file mode 100644 index 0000000000000000000000000000000000000000..077089ceccfa5dd76cefbeda7ead5b0f5c2c3606 --- /dev/null +++ b/dai/server/linear.py @@ -0,0 +1,104 @@ +import pymysql.cursors +import numpy as np +import re +from collections import Counter +connection = pymysql.connect(host='localhost', + user='root', + password='12345678', + database='soft', + cursorclass=pymysql.cursors.DictCursor) +cursor=connection.cursor() + +sql="select * from salary where type=1" + +cursor.execute(sql) +result=cursor.fetchall() +def getScore(): + results=[] + for item in result: + results.append(item["skills"].replace(" ","").split("\n")) + + temp=[] + for item in results: + temp+=item + temps=[] + + for item in temp: + if item: + temps.append(item) + + counInfo=Counter(temps) + print(counInfo) + counInfo=counInfo.most_common() + + counInfoList=[] + + for item in counInfo: + counInfoList.append(list(item)) + + sums=0 + + for item in counInfoList: + sums+=item[1] + for item in counInfoList: + item[1]=item[1]/sums + + counInfoDict={} + for item in counInfoList: + counInfoDict[item[0]]=item[1] + + return counInfoDict + +# 以字典的方式来记录技能对应的权重(分值) +score=getScore() + + +X=[] +Y=[] +cityMark={"太原":1,"北京":2} + +eduMark={"大专":1,"本科":2,"硕士":3,"博士":4,"不限专业":0} + +for item in result: + str1 = item["salary"] + if not (re.findall("天", str1)) and re.findall("(千|万)", str1): + a=[] + a.append(1) + # 城市 + a.append(cityMark[item["city"]]) + #学历 + edu=item["education"].replace(" ","").replace("\n","") + a.append(eduMark.get(edu,0)) + #工作年限 + workage=item["workage"].replace(" ","").replace("\n","") + if re.findall("\d",workage): + workage=workage[:1] + else: + workage=1 + a.append(workage) + #技能值 + scores=0 + for i in item["skills"].replace(" ","").split("\n"): + if i: + scores+=score[i] + print(scores) + a.append(scores) + X.append(a) + + nums=re.findall("\d+\.{0,1}\d*",str1) + flag=re.findall("(千|万)",str1) + num1=float(nums[0])*1000 if flag[0]=="千" else float(nums[0])*10000 + num2=float(nums[1])*1000 if flag[1]=="千" else float(nums[1])*10000 + avg=(num1+num2)/2 + Y.append(avg) + +X=np.array(X).astype(float) +Y=np.array(Y) +print(X) +print(Y) +theta=np.linalg.pinv(X.T.dot(X)).dot(X.T).dot(Y) +print(theta) +f=open("theta.py","w") +f.write("import numpy as np \ntheta="+str(list(theta))) + + diff --git a/dai/server/server.py b/dai/server/server.py new file mode 100644 index 0000000000000000000000000000000000000000..fd440cf8718bb9a0f191a25a95c34c3194fb7826 --- /dev/null +++ b/dai/server/server.py @@ -0,0 +1,142 @@ +from flask import Flask,request +from flask_cors import CORS +import pymysql.cursors +from collections import Counter +import re +connection = pymysql.connect(host='localhost', + user='root', + password='1234', + database='soft', + cursorclass=pymysql.cursors.DictCursor) +cursor=connection.cursor() +app=Flask(__name__) +CORS(app,resources={r"/*":{"origins":"*"} }) + +@app.route("/getMovieData") +def getJiqiXueData(): + sql="select * from grade" + cursor.execute(sql) + result=cursor.fetchall() + connection.commit() + return result +@app.route("/getTypeTopEcharts") +def getJiqiXueSkillEcharts(): + sql = "select type from grade" + cursor.execute(sql) + result = cursor.fetchall() + connection.commit() + infos=[] + for item in result: + infos+=(item["type"].replace(" ","").split("\n")) + + infos=(Counter(infos)) + infos=infos.most_common() + print(infos) + X=[] + Y=[] + for item in infos: + if item[0]: + X.append(item[0]) + Y.append(item[1]) + + return [X[:10],Y[:10]] +@app.route("/getJiqiXueEduEcharts") +def getJiqiXueEduEcharts(): + sql = "select education from salary where type=1" + cursor.execute(sql) + result = cursor.fetchall() + connection.commit() + infos=[] + for item in result: + if item["education"].replace(" ","").replace("\n",""): + infos.append(item["education"].replace(" ","").replace("\n","")) + infos=(Counter(infos).most_common()) + arr=[] + for item in infos: + obj={} + obj["value"]=item[1] + obj["name"]=item[0] + arr.append(obj) + return arr + +@app.route("/getJiqiXueEduAndSalaryEcharts") +def getJiqiXueEduAndSalaryEcharts(): + sql = "select education,salary from salary where type=1" + cursor.execute(sql) + result = cursor.fetchall() + connection.commit() + + total={} + totalnum={} + for item in result: + if item["education"]: + edu=item["education"].replace(" ","").replace("\n","") + price=item["salary"].replace(" ","").replace("\n","") + + if not(re.findall("天",price)) and re.findall("(千|万)",price): + nums=re.findall("\d+\.{0,1}\d*",price) + flag=re.findall("(千|万)",price) + num1=float(nums[0])*1000 if flag[0]=="千" else float(nums[0])*10000 + num2=float(nums[1])*1000 if flag[1]=="千" else float(nums[1])*10000 + avg=(num1+num2)/2 + if total.get(edu): + total[edu]+=avg + totalnum[edu]+=1 + else: + total[edu]=avg + totalnum[edu]=1 + + X=[] + Y=[] + for item in total: + X.append(item) + Y.append(total[item]/totalnum[item]) + + print(X) + print(Y) + return [X,Y] +@app.route("/getSkillScore") +def getSkillScore(): + sql = "select skills from salary where type=1" + cursor.execute(sql) + result = cursor.fetchall() + connection.commit() + + infos = [] + for item in result: + infos += (item["skills"].replace(" ", "").split("\n")) + + infos = (Counter(infos)) + infos = infos.most_common() + total=0 + newinfos=[] + for item in infos: + if item[0]: + total+=item[1] + newinfos.append(list(item)) + for item in newinfos: + item[1]=item[1]/total + return newinfos + +@app.route("/predict") +def predict(): + X=[] + city=float(request.args.get("city")) + workage=float(request.args.get("workage")) + education=float(request.args.get("education")) + skills=request.args.get("skills") + nums=0 + for item in skills.split(","): + nums+=float(item) + + X.append(1) + X.append(city) + X.append(education) + X.append(workage) + X.append(nums) + from theta import theta + import numpy as np + X=np.array(X) + theta=np.array(theta) + return str(X.dot(theta)) +app.run() \ No newline at end of file diff --git a/dai/server/shuxuelaoshimodel.py b/dai/server/shuxuelaoshimodel.py new file mode 100644 index 0000000000000000000000000000000000000000..bb2d2958bd23b7c0e10f8078437ee73ced22fae3 --- /dev/null +++ b/dai/server/shuxuelaoshimodel.py @@ -0,0 +1,2 @@ +import numpy as np +theta=[np.float64(1506.1203949738149), np.float64(8376.074233976547), np.float64(316.66944820274193), np.float64(1168.1878279261841), np.float64(-21481.65858932624)] \ No newline at end of file diff --git a/dai/server/theta.py b/dai/server/theta.py new file mode 100644 index 0000000000000000000000000000000000000000..bb2d2958bd23b7c0e10f8078437ee73ced22fae3 --- /dev/null +++ b/dai/server/theta.py @@ -0,0 +1,2 @@ +import numpy as np +theta=[np.float64(1506.1203949738149), np.float64(8376.074233976547), np.float64(316.66944820274193), np.float64(1168.1878279261841), np.float64(-21481.65858932624)] \ No newline at end of file diff --git a/dai/src/App.vue b/dai/src/App.vue new file mode 100644 index 0000000000000000000000000000000000000000..dd8524f6c442bb7e9a096d02dcce749b1facfa7b --- /dev/null +++ b/dai/src/App.vue @@ -0,0 +1,129 @@ + + + + \ No newline at end of file diff --git a/dai/src/assets/1.png b/dai/src/assets/1.png new file mode 100644 index 0000000000000000000000000000000000000000..8976d81d6c1ed1589e97735484da0220b87441c0 Binary files /dev/null and b/dai/src/assets/1.png differ diff --git a/dai/src/assets/2.png b/dai/src/assets/2.png new file mode 100644 index 0000000000000000000000000000000000000000..956ab2b1ca0636bd85e4e2496effec4e0a72fbe7 Binary files /dev/null and b/dai/src/assets/2.png differ diff --git a/dai/src/assets/3.png b/dai/src/assets/3.png new file mode 100644 index 0000000000000000000000000000000000000000..3af10135b34c3982427e045c4a890360e04dacaf Binary files /dev/null and b/dai/src/assets/3.png differ diff --git a/dai/src/assets/logo.png b/dai/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 Binary files /dev/null and b/dai/src/assets/logo.png differ diff --git a/dai/src/components/HelloWorld.vue b/dai/src/components/HelloWorld.vue new file mode 100644 index 0000000000000000000000000000000000000000..669d8812d6e82796488ae0d8f80b79bb6c7a1144 --- /dev/null +++ b/dai/src/components/HelloWorld.vue @@ -0,0 +1,58 @@ + + + + + + diff --git a/dai/src/main.js b/dai/src/main.js new file mode 100644 index 0000000000000000000000000000000000000000..a018b90c323ac7e0c380b28880c2cfa895e930ec --- /dev/null +++ b/dai/src/main.js @@ -0,0 +1,13 @@ +import Vue from 'vue' +import App from './App.vue' +import router from './router' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +Vue.use(ElementUI) + +Vue.config.productionTip = false + +new Vue({ + router, + render: h => h(App) +}).$mount('#app') diff --git a/dai/src/router/index.js b/dai/src/router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..96f549b2cb683f600c024a9e894e01b459595102 --- /dev/null +++ b/dai/src/router/index.js @@ -0,0 +1,77 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' +import HomeView from '../views/HomeView.vue' +import ccc from '../views/ccc.vue' +import ddd from '../views/ddd.vue' +import eee from '../views/eee.vue' +import getMovie from '../views/getMovie.vue' +import jiqixuexiform from '../views/jiqixuexiform.vue' +import jiqiecharts from '../views/jiqiecharts.vue' +import type from '../views/type.vue' +import GradeP from '../views/GradeP.vue' + + + +Vue.use(VueRouter) + +const routes = [ + // { + // path: '/', + // name: 'home', + // component: HomeView + // }, + { + path: '/ccc', + name: 'ccc', + component: ccc + }, + { + path: '/GradeP', + name: 'GradeP', + component: GradeP + }, + { + path: '/type', + name: 'home', + component: type + }, + { + path: '/ddd', + name: 'ddd', + component: ddd + }, + { + path: '/getMovie', + name: 'home', + component: getMovie + }, + { + path: '/jiqixuexiform', + name: 'jiqixuexiform', + component: jiqixuexiform + }, + { + path: '/eee', + name: 'eee', + component: eee + }, + { + path: '/jiqiecharts', + name: 'home', + component: jiqiecharts + }, + { + path: '/about', + name: 'about', + // route level code-splitting + // this generates a separate chunk (about.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') + } +] + +const router = new VueRouter({ + routes +}) + +export default router diff --git a/dai/src/views/AboutView.vue b/dai/src/views/AboutView.vue new file mode 100644 index 0000000000000000000000000000000000000000..3fa28070de24f2055171ca2e20543881cb7fdf1c --- /dev/null +++ b/dai/src/views/AboutView.vue @@ -0,0 +1,5 @@ + diff --git a/dai/src/views/GradeP.vue b/dai/src/views/GradeP.vue new file mode 100644 index 0000000000000000000000000000000000000000..8a12b14470fa9edccb15934e7009f3ea86aae996 --- /dev/null +++ b/dai/src/views/GradeP.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/HomeView.vue b/dai/src/views/HomeView.vue new file mode 100644 index 0000000000000000000000000000000000000000..e8d96d7a7049d1ddda2073b5bed757935fc35fbc --- /dev/null +++ b/dai/src/views/HomeView.vue @@ -0,0 +1,18 @@ + + + diff --git a/dai/src/views/ccc.vue b/dai/src/views/ccc.vue new file mode 100644 index 0000000000000000000000000000000000000000..b34b77eabc805c1d200e09c2375df241c004c1e5 --- /dev/null +++ b/dai/src/views/ccc.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/ddd.vue b/dai/src/views/ddd.vue new file mode 100644 index 0000000000000000000000000000000000000000..412a6bb5f46de46fea4a29afdcd9d876757ce4fb --- /dev/null +++ b/dai/src/views/ddd.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/dai/src/views/eee.vue b/dai/src/views/eee.vue new file mode 100644 index 0000000000000000000000000000000000000000..6954be2f2f0b4436c347196d9eab2edd65494b77 --- /dev/null +++ b/dai/src/views/eee.vue @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/dai/src/views/getMovie.vue b/dai/src/views/getMovie.vue new file mode 100644 index 0000000000000000000000000000000000000000..8baf3b36031386cec792879e8aacadddabe5de28 --- /dev/null +++ b/dai/src/views/getMovie.vue @@ -0,0 +1,50 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/jiqiecharts.vue b/dai/src/views/jiqiecharts.vue new file mode 100644 index 0000000000000000000000000000000000000000..42c8935ad6ef441923af867607b49812a4d9a3b3 --- /dev/null +++ b/dai/src/views/jiqiecharts.vue @@ -0,0 +1,124 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/jiqixuexiform.vue b/dai/src/views/jiqixuexiform.vue new file mode 100644 index 0000000000000000000000000000000000000000..68e6ce4cff877d4a388aa8684f654e893413d51c --- /dev/null +++ b/dai/src/views/jiqixuexiform.vue @@ -0,0 +1,86 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/star.vue b/dai/src/views/star.vue new file mode 100644 index 0000000000000000000000000000000000000000..1be61c39100d5a09cdbd558798e8f697eb1d26ef --- /dev/null +++ b/dai/src/views/star.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/dai/src/views/type.vue b/dai/src/views/type.vue new file mode 100644 index 0000000000000000000000000000000000000000..f721c9ac1f99a81aa0321bcad64fbabe6989c73e --- /dev/null +++ b/dai/src/views/type.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git "a/\351\241\271\347\233\256\346\210\252\345\233\276/1\347\224\265\345\275\261\344\277\241\346\201\257.png" "b/\351\241\271\347\233\256\346\210\252\345\233\276/1\347\224\265\345\275\261\344\277\241\346\201\257.png" new file mode 100644 index 0000000000000000000000000000000000000000..f828a6f38a268c0ff6ce995f51c8c1508a560cb9 Binary files /dev/null and "b/\351\241\271\347\233\256\346\210\252\345\233\276/1\347\224\265\345\275\261\344\277\241\346\201\257.png" differ diff --git "a/\351\241\271\347\233\256\346\210\252\345\233\276/2 \347\261\273\345\236\213\346\216\222\350\241\214\346\246\234.png" "b/\351\241\271\347\233\256\346\210\252\345\233\276/2 \347\261\273\345\236\213\346\216\222\350\241\214\346\246\234.png" new file mode 100644 index 0000000000000000000000000000000000000000..f6ea9975db91c8d1206cd4f7454580206e42611a Binary files /dev/null and "b/\351\241\271\347\233\256\346\210\252\345\233\276/2 \347\261\273\345\236\213\346\216\222\350\241\214\346\246\234.png" differ diff --git "a/\351\241\271\347\233\256\346\210\252\345\233\276/3 \351\242\204\346\265\213\351\241\265\351\235\242.png" "b/\351\241\271\347\233\256\346\210\252\345\233\276/3 \351\242\204\346\265\213\351\241\265\351\235\242.png" new file mode 100644 index 0000000000000000000000000000000000000000..e33b4c9454f25af1576e228d9bc12a1bbd33a5d6 Binary files /dev/null and "b/\351\241\271\347\233\256\346\210\252\345\233\276/3 \351\242\204\346\265\213\351\241\265\351\235\242.png" differ diff --git "a/\351\241\271\347\233\256\350\257\264\346\230\216\346\226\207\346\241\243.docx" "b/\351\241\271\347\233\256\350\257\264\346\230\216\346\226\207\346\241\243.docx" new file mode 100644 index 0000000000000000000000000000000000000000..2328f84b2fe4a4ebc6da83e97c79a469b56ddea1 Binary files /dev/null and "b/\351\241\271\347\233\256\350\257\264\346\230\216\346\226\207\346\241\243.docx" differ